Always display windows update step (#781)

* always display windows update step

* remove extra comma

* i guess format wants the comma
This commit is contained in:
edi
2024-05-06 13:24:57 +01:00
committed by GitHub
parent 614131b7bf
commit a3428e3477
2 changed files with 16 additions and 15 deletions

View File

@@ -7,7 +7,7 @@ use tracing::debug;
use crate::command::CommandExt;
use crate::execution_context::ExecutionContext;
use crate::terminal::print_separator;
use crate::terminal::{print_separator, print_warning};
use crate::utils::{require, which};
use crate::{error::SkipStep, steps::git::RepoStep};
use crate::{powershell, Step};
@@ -201,15 +201,16 @@ pub fn run_wsl_topgrade(ctx: &ExecutionContext) -> Result<()> {
pub fn windows_update(ctx: &ExecutionContext) -> Result<()> {
let powershell = powershell::Powershell::windows_powershell();
print_separator("Windows Update");
if powershell.supports_windows_update() {
print_separator("Windows Update");
powershell.windows_update(ctx)
} else {
Err(SkipStep(
"Consider installing PSWindowsUpdate as the use of Windows Update via usoclient is not supported."
.to_string(),
)
.into())
print_warning(
"Consider installing PSWindowsUpdate as the use of Windows Update via USOClient is not supported.",
);
Err(SkipStep("USOClient not supported.".to_string()).into())
}
}