Add warning when initializing a wasmer.toml file from a Cargo.toml

This commit is contained in:
Felix Schütt
2022-12-17 00:05:01 +01:00
parent 964b897133
commit adafb28f64

View File

@@ -108,7 +108,7 @@ impl Init {
}; };
let cargo_toml = if manifest_path.exists() { let cargo_toml = if manifest_path.exists() {
Some(parse_cargo_toml(&manifest_path)?) parse_cargo_toml(&manifest_path).ok()
} else { } else {
None None
}; };
@@ -346,6 +346,14 @@ fn construct_manifest(
include_fs: &[String], include_fs: &[String],
quiet: bool, quiet: bool,
) -> wapm_toml::Manifest { ) -> 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(|| { let package_name = package_name.unwrap_or_else(|| {
cargo_toml cargo_toml
.as_ref() .as_ref()