summaryrefslogtreecommitdiff
path: root/cli/tools/vendor/mod.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-04-05 10:34:51 -0400
committerGitHub <noreply@github.com>2024-04-05 10:34:51 -0400
commit049e703331409db8c4b4e2cc7d969f471c229df3 (patch)
treea31458a651e931d2047c348bdcbe0379470bf925 /cli/tools/vendor/mod.rs
parentee4bfe16009c3a04c9015bf9fca0c9b0f9a3a601 (diff)
FUTURE: override byonm with nodeModulesDir setting (#23222)
Makes the `"nodeModulesDir"` setting take precedence over byonm when using `DENO_FUTURE`.
Diffstat (limited to 'cli/tools/vendor/mod.rs')
-rw-r--r--cli/tools/vendor/mod.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/cli/tools/vendor/mod.rs b/cli/tools/vendor/mod.rs
index 2e01d1963..5a76365ee 100644
--- a/cli/tools/vendor/mod.rs
+++ b/cli/tools/vendor/mod.rs
@@ -99,13 +99,14 @@ pub async fn vendor(
// cache the node_modules folder when it's been added to the config file
if modified_result.added_node_modules_dir {
- let node_modules_path = cli_options.node_modules_dir_path().or_else(|| {
- cli_options
- .maybe_config_file_specifier()
- .filter(|c| c.scheme() == "file")
- .and_then(|c| c.to_file_path().ok())
- .map(|config_path| config_path.parent().unwrap().join("node_modules"))
- });
+ let node_modules_path =
+ cli_options.node_modules_dir_path().cloned().or_else(|| {
+ cli_options
+ .maybe_config_file_specifier()
+ .filter(|c| c.scheme() == "file")
+ .and_then(|c| c.to_file_path().ok())
+ .map(|config_path| config_path.parent().unwrap().join("node_modules"))
+ });
if let Some(node_modules_path) = node_modules_path {
let cli_options =
cli_options.with_node_modules_dir_path(node_modules_path);