From adafb28f64c11e24a2f08221eaef6257c26d40e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Sat, 17 Dec 2022 00:05:01 +0100 Subject: [PATCH] Add warning when initializing a wasmer.toml file from a Cargo.toml --- lib/cli/src/commands/init.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/cli/src/commands/init.rs b/lib/cli/src/commands/init.rs index 7b1a206c3..7b1cd5818 100644 --- a/lib/cli/src/commands/init.rs +++ b/lib/cli/src/commands/init.rs @@ -108,7 +108,7 @@ impl Init { }; let cargo_toml = if manifest_path.exists() { - Some(parse_cargo_toml(&manifest_path)?) + parse_cargo_toml(&manifest_path).ok() } else { None }; @@ -346,6 +346,14 @@ fn construct_manifest( include_fs: &[String], quiet: bool, ) -> wapm_toml::Manifest { + if cargo_toml.is_some() { + let msg = "NOTE: Initializing wasmer.toml file with metadata from Cargo.toml"; + if !quiet { + println!("{msg}"); + } + log::warn!("{msg}"); + } + let package_name = package_name.unwrap_or_else(|| { cargo_toml .as_ref()