Add minor refactorings (#754)

This commit is contained in:
Marcin Puc
2021-09-04 20:01:19 +02:00
committed by GitHub
parent 7db0c03621
commit 1478d079ca
21 changed files with 119 additions and 147 deletions

View File

@@ -27,7 +27,7 @@ impl NPM {
#[cfg(target_os = "linux")]
fn root(&self) -> Result<PathBuf> {
Command::new(&self.command)
.args(&["root", "-g"])
.args(["root", "-g"])
.check_output()
.map(|s| PathBuf::from(s.trim()))
}
@@ -37,10 +37,10 @@ impl NPM {
run_type
.execute("sudo")
.arg(&self.command)
.args(&["update", "-g"])
.args(["update", "-g"])
.check_run()?;
} else {
run_type.execute(&self.command).args(&["update", "-g"]).check_run()?;
run_type.execute(&self.command).args(["update", "-g"]).check_run()?;
}
Ok(())
@@ -84,7 +84,7 @@ pub fn pnpm_global_update(run_type: RunType) -> Result<()> {
let pnpm = require("pnpm")?;
print_separator("Performant Node Package Manager");
run_type.execute(&pnpm).args(&["update", "-g"]).check_run()
run_type.execute(&pnpm).args(["update", "-g"]).check_run()
}
pub fn deno_upgrade(ctx: &ExecutionContext) -> Result<()> {