Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(install/global): warn about not including auto-discovered config file #27745

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cli/tools/installer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 5 additions & 0 deletions tests/specs/install/global/warn_config_file/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tempDir": true,
"args": "install --root ./bins -g --name my-cli main.js",
"output": "install.out"
}
2 changes: 2 additions & 0 deletions tests/specs/install/global/warn_config_file/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
3 changes: 3 additions & 0 deletions tests/specs/install/global/warn_config_file/install.out
Original file line number Diff line number Diff line change
@@ -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]
1 change: 1 addition & 0 deletions tests/specs/install/global/warn_config_file/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log(1);
Loading