diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-06-10 19:56:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-10 23:56:43 +0000 |
commit | d74be0842a32e4f08551be8371447254254e7ab4 (patch) | |
tree | 1f2a66806d1ed669313cdf8b7fc88d0a5c59b769 /cli/tools/installer.rs | |
parent | 7996c0df92f53585cf8abb8844793c1e3aaea078 (diff) |
FUTURE: support `deno install <alias>@npm:<package>` (#24156)
Closes #23144
Diffstat (limited to 'cli/tools/installer.rs')
-rw-r--r-- | cli/tools/installer.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index 34ecc66be..c920489f2 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -287,13 +287,20 @@ pub async fn install_command( log::warn!("⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag."); } - let install_flags_global = match install_flags.kind { - InstallKind::Global(flags) => flags, + match install_flags.kind { + InstallKind::Global(global_flags) => { + install_global(flags, global_flags).await + } InstallKind::Local(maybe_add_flags) => { - return install_local(flags, maybe_add_flags).await + install_local(flags, maybe_add_flags).await } - }; + } +} +async fn install_global( + flags: Flags, + install_flags_global: InstallFlagsGlobal, +) -> Result<(), AnyError> { // ensure the module is cached let factory = CliFactory::from_flags(flags.clone())?; factory |