Support for updating the node package manager
One could consider to also run `npm audit fix` as is suggested by `npm`.
This commit is contained in:
committed by
Roey Darwish Dror
parent
82f44cd173
commit
4c31530c0b
17
src/main.rs
17
src/main.rs
@@ -251,6 +251,23 @@ fn main() -> Result<(), Error> {
|
||||
.report("System upgrade", &mut reports);;
|
||||
}
|
||||
|
||||
if let Ok(npm) = which("npm") {
|
||||
terminal.print_separator("Node Package Manager");
|
||||
Command::new(&npm)
|
||||
.args(&["install", "npm"])
|
||||
.spawn()?
|
||||
.wait()?
|
||||
.check()
|
||||
.and_then(|()| {
|
||||
Command::new(&npm)
|
||||
.args(&["update", "-g"])
|
||||
.spawn()?
|
||||
.wait()
|
||||
.map_err(Error::from)
|
||||
})?
|
||||
.report("Node Package Manager", &mut reports);
|
||||
}
|
||||
|
||||
let mut reports: Vec<_> = reports.into_iter().collect();
|
||||
reports.sort();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user