Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Optimize installing npm deps on mac [WIP] #23573

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
Fmt
  • Loading branch information
nathanwhit committed Apr 25, 2024
commit f43149fb9a116819a83dc98d7f521eb561b24615
15 changes: 8 additions & 7 deletions cli/args/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,15 +803,15 @@ impl Flags {
std::env::current_dir().ok()
}
Add(_) | Bundle(_) | Completions(_) | Doc(_) | Fmt(_) | Init(_)
| Uninstall(_) | Jupyter(_) | Lsp | Lint(_) | Types
| Upgrade(_) | Vendor(_) => None,
| Uninstall(_) | Jupyter(_) | Lsp | Lint(_) | Types | Upgrade(_)
| Vendor(_) => None,
Install(_) => {
if *DENO_FUTURE {
std::env::current_dir().ok()
} else {
None
}
},
}
}
}

Expand Down Expand Up @@ -1988,7 +1988,7 @@ The installation root is determined, in order of precedence:

These must be added to the path manually if required.")
.defer(|cmd| {
let cmd =
let cmd =
runtime_args(cmd, true, true)
.arg(check_arg(true));

Expand All @@ -1997,7 +1997,7 @@ These must be added to the path manually if required.")
} else {
cmd.arg(Arg::new("cmd").required(true).num_args(1..).value_hint(ValueHint::FilePath))
};

cmd.arg(
Arg::new("name")
.long("name")
Expand Down Expand Up @@ -3738,13 +3738,14 @@ fn info_parse(flags: &mut Flags, matches: &mut ArgMatches) {

fn install_parse(flags: &mut Flags, matches: &mut ArgMatches) {
runtime_args_parse(flags, matches, true, true);

let global = matches.get_flag("global");
if global {
let root = matches.remove_one::<String>("root");
let force = matches.get_flag("force");
let name = matches.remove_one::<String>("name");
let mut cmd_values = matches.remove_many::<String>("cmd").unwrap_or_default();
let mut cmd_values =
matches.remove_many::<String>("cmd").unwrap_or_default();

let module_url = cmd_values.next().unwrap();
let args = cmd_values.collect();
Expand Down