Windows step refactoring

This commit is contained in:
Roey Darwish Dror
2019-02-11 20:38:51 +02:00
parent e2d42b77a7
commit a85311608e
3 changed files with 40 additions and 71 deletions

View File

@@ -134,10 +134,12 @@ fn run() -> Result<(), Error> {
#[cfg(windows)]
{
if powershell.profile().is_some() && config.should_run(Step::Powershell) {
report.push_result(execute_legacy(
execute(
&mut report,
"Powershell Modules Update",
|| powershell.update_modules(run_type),
config.no_retry(),
)?);
)?;
}
}
@@ -168,10 +170,15 @@ fn run() -> Result<(), Error> {
}
#[cfg(windows)]
report.push_result(execute_legacy(|| windows::run_chocolatey(run_type), config.no_retry())?);
execute(
&mut report,
"Chocolatey",
|| windows::run_chocolatey(run_type),
config.no_retry(),
)?;
#[cfg(windows)]
report.push_result(execute_legacy(|| windows::run_scoop(run_type), config.no_retry())?);
execute(&mut report, "Scoop", || windows::run_scoop(run_type), config.no_retry())?;
#[cfg(unix)]
report.push_result(execute_legacy(
@@ -383,10 +390,12 @@ fn run() -> Result<(), Error> {
#[cfg(windows)]
{
if config.should_run(Step::System) {
report.push_result(execute_legacy(
execute(
&mut report,
"Windows update",
|| powershell.windows_update(run_type),
config.no_retry(),
)?);
)?;
}
}