Add option to disable node package updates (#213)

This commit is contained in:
Mikkel Kroman
2019-09-04 12:57:22 +02:00
committed by Roey Darwish Dror
parent bfbb486fba
commit 7bdd00f88a
2 changed files with 23 additions and 18 deletions

View File

@@ -28,6 +28,7 @@ lazy_static! {
m.insert("vim", Step::Vim); m.insert("vim", Step::Vim);
m.insert("emacs", Step::Emacs); m.insert("emacs", Step::Emacs);
m.insert("gem", Step::Gem); m.insert("gem", Step::Gem);
m.insert("node", Step::Node);
m.insert("sdkman", Step::Sdkman); m.insert("sdkman", Step::Sdkman);
m.insert("remotes", Step::Remotes); m.insert("remotes", Step::Remotes);
m.insert("rustup", Step::Rustup); m.insert("rustup", Step::Rustup);
@@ -53,6 +54,8 @@ pub enum Step {
Emacs, Emacs,
/// Don't upgrade ruby gems /// Don't upgrade ruby gems
Gem, Gem,
/// Don't upgrade npm/composer/yarn packages
Node,
/// Don't upgrade SDKMAN! and its packages /// Don't upgrade SDKMAN! and its packages
Sdkman, Sdkman,
/// Don't run remote Togprades /// Don't run remote Togprades

View File

@@ -351,6 +351,7 @@ fn run() -> Result<(), Error> {
)?; )?;
} }
if config.should_run(Step::Node) {
execute( execute(
&mut report, &mut report,
"NPM", "NPM",
@@ -369,6 +370,7 @@ fn run() -> Result<(), Error> {
|| node::yarn_global_update(run_type), || node::yarn_global_update(run_type),
config.no_retry(), config.no_retry(),
)?; )?;
}
#[cfg(not(any( #[cfg(not(any(
target_os = "freebsd", target_os = "freebsd",