summaryrefslogtreecommitdiff
path: root/cli/tools
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-05-13 17:40:50 +0200
committerGitHub <noreply@github.com>2022-05-13 17:40:50 +0200
commit939a070c8cbe77626e07a01646c324b2ae5ac740 (patch)
treefed6f4053e2185380b9acabf17c1cf3b64e9d119 /cli/tools
parentb543e84b399ccfff9446d19c3b4cc55dab85c039 (diff)
feat: add --no-config flag (#14555)
This flag disables loading of configuration file, ie. it will not be automatically discovered and loaded. Of course this flag conflicts with "--config" flag and they cannot be used together.
Diffstat (limited to 'cli/tools')
-rw-r--r--cli/tools/installer.rs8
-rw-r--r--cli/tools/standalone.rs2
2 files changed, 7 insertions, 3 deletions
diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs
index 8ebbf8f53..2dc86f0dc 100644
--- a/cli/tools/installer.rs
+++ b/cli/tools/installer.rs
@@ -1,5 +1,6 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+use crate::flags::ConfigFlag;
use crate::flags::Flags;
use crate::flags::InstallFlags;
use crate::flags::TypeCheckMode;
@@ -361,7 +362,7 @@ fn resolve_shim_data(
executable_args.push(import_map_url.to_string());
}
- if let Some(config_path) = &flags.config_path {
+ if let ConfigFlag::Path(config_path) = &flags.config_flag {
let mut copy_path = file_path.clone();
copy_path.set_extension("tsconfig.json");
executable_args.push("--config".to_string());
@@ -404,6 +405,7 @@ fn is_in_path(dir: &Path) -> bool {
mod tests {
use super::*;
+ use crate::flags::ConfigFlag;
use std::process::Command;
use test_util::testdata_path;
use test_util::TempDir;
@@ -771,7 +773,9 @@ mod tests {
let result = install(
Flags {
- config_path: Some(config_file_path.to_string_lossy().to_string()),
+ config_flag: ConfigFlag::Path(
+ config_file_path.to_string_lossy().to_string(),
+ ),
..Flags::default()
},
InstallFlags {
diff --git a/cli/tools/standalone.rs b/cli/tools/standalone.rs
index 9f24b5f08..d682ed88c 100644
--- a/cli/tools/standalone.rs
+++ b/cli/tools/standalone.rs
@@ -264,7 +264,7 @@ pub fn compile_to_runtime_flags(
cache_blocklist: vec![],
cache_path: None,
cached_only: false,
- config_path: None,
+ config_flag: Default::default(),
coverage_dir: flags.coverage_dir.clone(),
enable_testing_features: false,
ignore: vec![],