diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-03 15:56:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 13:56:39 +0000 |
commit | b8ed6f822174b2322fbe9f8b58698b76b5505b4a (patch) | |
tree | 324f208e53ac8f5ee1f04e7c69fc7d8f4946c81e /cli | |
parent | 7c594023256ffdc8a16db017676319da448dd926 (diff) |
fix(task): correct name for scoped npm package binaries (#25390)
This is for when not using a node_modules directory or when using auto
install for a node_modules dir.
Diffstat (limited to 'cli')
-rw-r--r-- | cli/tools/task.rs | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/cli/tools/task.rs b/cli/tools/task.rs index 23da5b4fb..cc16bb9a3 100644 --- a/cli/tools/task.rs +++ b/cli/tools/task.rs @@ -1,13 +1,13 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use crate::args::CliOptions; -use crate::args::Flags; -use crate::args::TaskFlags; -use crate::colors; -use crate::factory::CliFactory; -use crate::npm::CliNpmResolver; -use crate::task_runner; -use crate::util::fs::canonicalize_path; +use std::borrow::Cow; +use std::collections::HashMap; +use std::collections::HashSet; +use std::path::Path; +use std::path::PathBuf; +use std::rc::Rc; +use std::sync::Arc; + use deno_config::deno_json::Task; use deno_config::workspace::TaskOrScript; use deno_config::workspace::WorkspaceDirectory; @@ -18,13 +18,15 @@ use deno_core::anyhow::Context; use deno_core::error::AnyError; use deno_core::normalize_path; use deno_task_shell::ShellCommand; -use std::borrow::Cow; -use std::collections::HashMap; -use std::collections::HashSet; -use std::path::Path; -use std::path::PathBuf; -use std::rc::Rc; -use std::sync::Arc; + +use crate::args::CliOptions; +use crate::args::Flags; +use crate::args::TaskFlags; +use crate::colors; +use crate::factory::CliFactory; +use crate::npm::CliNpmResolver; +use crate::task_runner; +use crate::util::fs::canonicalize_path; pub async fn execute_script( flags: Arc<Flags>, @@ -106,12 +108,9 @@ See https://docs.deno.com/go/config"# .await } TaskOrScript::Script(scripts, _script) => { - // ensure the npm packages are installed if using a node_modules - // directory and managed resolver - if cli_options.has_node_modules_dir() { - if let Some(npm_resolver) = npm_resolver.as_managed() { - npm_resolver.ensure_top_level_package_json_install().await?; - } + // ensure the npm packages are installed if using a managed resolver + if let Some(npm_resolver) = npm_resolver.as_managed() { + npm_resolver.ensure_top_level_package_json_install().await?; } let cwd = match task_flags.cwd { |