mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 13:44:08 +00:00
fix(npm): package.json auto-discovery should respect --no-config
and --no-npm
(#17924)
Part of #17916
This commit is contained in:
parent
6472afd12b
commit
7ad64283a1
4 changed files with 30 additions and 3 deletions
|
@ -568,7 +568,9 @@ impl CliOptions {
|
|||
let maybe_config_file = ConfigFile::discover(&flags, &initial_cwd)?;
|
||||
|
||||
let mut maybe_package_json = None;
|
||||
if let Some(config_file) = &maybe_config_file {
|
||||
if flags.config_flag == ConfigFlag::Disabled || flags.no_npm {
|
||||
log::debug!("package.json auto-discovery is disabled")
|
||||
} else if let Some(config_file) = &maybe_config_file {
|
||||
let specifier = config_file.specifier.clone();
|
||||
if specifier.scheme() == "file" {
|
||||
let maybe_stop_at = specifier
|
||||
|
@ -582,6 +584,7 @@ impl CliOptions {
|
|||
} else {
|
||||
maybe_package_json = discover_package_json(&flags, None)?;
|
||||
}
|
||||
|
||||
let maybe_lock_file =
|
||||
lockfile::discover(&flags, maybe_config_file.as_ref())?;
|
||||
Self::new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue