Add flags to disable rust and cargo (fix #200)

This commit is contained in:
Roey Darwish Dror
2019-08-19 20:15:01 +03:00
parent aed18426f7
commit f5c2368a4d
2 changed files with 23 additions and 12 deletions

View File

@@ -24,6 +24,8 @@ lazy_static! {
m.insert("gem", Step::Gem); m.insert("gem", Step::Gem);
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("cargo", Step::Cargo);
#[cfg(windows)] #[cfg(windows)]
m.insert("powershell", Step::Powershell); m.insert("powershell", Step::Powershell);
@@ -49,6 +51,10 @@ pub enum Step {
Sdkman, Sdkman,
/// Don't run remote Togprades /// Don't run remote Togprades
Remotes, Remotes,
/// Don't run Rustup
Rustup,
/// Don't run Cargo
Cargo,
/// Don't update Powershell modules /// Don't update Powershell modules
Powershell, Powershell,
} }

View File

@@ -278,18 +278,23 @@ fn run() -> Result<(), Error> {
)?; )?;
} }
execute( if config.should_run(Step::Rustup) {
&mut report, execute(
"rustup", &mut report,
|| generic::run_rustup(&base_dirs, run_type), "rustup",
config.no_retry(), || generic::run_rustup(&base_dirs, run_type),
)?; config.no_retry(),
execute( )?;
&mut report, }
"cargo",
|| generic::run_cargo_update(run_type), if config.should_run(Step::Cargo) {
config.no_retry(), execute(
)?; &mut report,
"cargo",
|| generic::run_cargo_update(run_type),
config.no_retry(),
)?;
}
if config.should_run(Step::Emacs) { if config.should_run(Step::Emacs) {
execute(&mut report, "Emacs", || emacs.upgrade(run_type), config.no_retry())?; execute(&mut report, "Emacs", || emacs.upgrade(run_type), config.no_retry())?;