summaryrefslogtreecommitdiff
path: root/cli/args/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/args/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/args/mod.rs')
-rw-r--r--cli/args/mod.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs
index e138e9d0b..8a65514bf 100644
--- a/cli/args/mod.rs
+++ b/cli/args/mod.rs
@@ -1102,15 +1102,11 @@ impl CliOptions {
}
pub fn has_node_modules_dir(&self) -> bool {
- if self.enable_future_features() {
- self.maybe_node_modules_folder.is_some()
- } else {
- self.maybe_node_modules_folder.is_some() || self.unstable_byonm()
- }
+ self.maybe_node_modules_folder.is_some()
}
- pub fn node_modules_dir_path(&self) -> Option<PathBuf> {
- self.maybe_node_modules_folder.clone()
+ pub fn node_modules_dir_path(&self) -> Option<&PathBuf> {
+ self.maybe_node_modules_folder.as_ref()
}
pub fn with_node_modules_dir_path(&self, path: PathBuf) -> Self {
@@ -1595,10 +1591,14 @@ impl CliOptions {
}
pub fn use_byonm(&self) -> bool {
- self.enable_future_features()
- }
+ if self.enable_future_features()
+ && self.node_modules_dir_enablement().is_none()
+ && self.maybe_package_json.is_some()
+ {
+ return true;
+ }
- pub fn unstable_byonm(&self) -> bool {
+ // check if enabled via unstable
self.flags.unstable_config.byonm
|| NPM_PROCESS_STATE
.as_ref()