diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index 0f14782a48..a021ac74fa 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -411,6 +411,12 @@ async fn install_global( .load_and_type_check_files(&[install_flags_global.module_url.clone()]) .await?; + if matches!(flags.config_flag, ConfigFlag::Discover) + && cli_options.workspace().deno_jsons().next().is_some() + { + log::warn!("{} discovered config file will be ignored in the installed command. Use the --config flag if you wish to include it.", crate::colors::yellow("Warning")); + } + // create the install shim create_install_shim(http_client, &flags, install_flags_global).await } diff --git a/tests/specs/install/global/warn_config_file/__test__.jsonc b/tests/specs/install/global/warn_config_file/__test__.jsonc new file mode 100644 index 0000000000..1d36d4c143 --- /dev/null +++ b/tests/specs/install/global/warn_config_file/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "install --root ./bins -g --name my-cli main.js", + "output": "install.out" +} diff --git a/tests/specs/install/global/warn_config_file/deno.json b/tests/specs/install/global/warn_config_file/deno.json new file mode 100644 index 0000000000..2c63c08510 --- /dev/null +++ b/tests/specs/install/global/warn_config_file/deno.json @@ -0,0 +1,2 @@ +{ +} diff --git a/tests/specs/install/global/warn_config_file/install.out b/tests/specs/install/global/warn_config_file/install.out new file mode 100644 index 0000000000..4ce57be390 --- /dev/null +++ b/tests/specs/install/global/warn_config_file/install.out @@ -0,0 +1,3 @@ +Warning discovered config file will be ignored in the installed command. Use the --config flag if you wish to include it. +✅ Successfully installed my-cli +[WILDCARD] diff --git a/tests/specs/install/global/warn_config_file/main.js b/tests/specs/install/global/warn_config_file/main.js new file mode 100644 index 0000000000..296d5492b0 --- /dev/null +++ b/tests/specs/install/global/warn_config_file/main.js @@ -0,0 +1 @@ +console.log(1);