diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-09-30 12:06:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-30 12:06:38 -0400 |
commit | 8d24be1a59714761665516e0d78d25059608c29b (patch) | |
tree | aed0140b63441008cb9b549d44948f7a36a4f5f1 /cli/tools/run.rs | |
parent | 1cda3840ff673512f7c6d58fa8402c35c760bc3b (diff) |
refactor(npm): create `cli::npm::managed` module (#20740)
Creates the `cli::npm::managed` module and starts moving more
functionality into it.
Diffstat (limited to 'cli/tools/run.rs')
-rw-r--r-- | cli/tools/run.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cli/tools/run.rs b/cli/tools/run.rs index 6ded628ea..5fb31a4ad 100644 --- a/cli/tools/run.rs +++ b/cli/tools/run.rs @@ -186,13 +186,11 @@ pub async fn eval_command( async fn maybe_npm_install(factory: &CliFactory) -> Result<(), AnyError> { // ensure an "npm install" is done if the user has explicitly - // opted into using a node_modules directory + // opted into using a managed node_modules directory if factory.cli_options().node_modules_dir_enablement() == Some(true) { - factory - .package_json_deps_installer() - .await? - .ensure_top_level_install() - .await?; + if let Some(npm_resolver) = factory.npm_resolver().await?.as_managed() { + npm_resolver.ensure_top_level_package_json_install().await?; + } } Ok(()) } |