From af2fd17afbd3496507509686fc3da8261d8c3eb6 Mon Sep 17 00:00:00 2001 From: Cryostrixx Date: Mon, 23 Sep 2024 11:01:02 -0700 Subject: [PATCH] Remove redundant update checking code in Get-WinUtilUpdates --- windev.ps1 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/windev.ps1 b/windev.ps1 index 63ff41ba..34cf932a 100644 --- a/windev.ps1 +++ b/windev.ps1 @@ -98,14 +98,11 @@ function Get-WinUtilUpdates { $RemoteWinUtilVersion = (([regex]($VersionExtractionRegEx)).Match($RawWinUtilScript).Groups[2].Value) $LocalWinUtilVersion = (([regex]($VersionExtractionRegEx)).Match((Get-Content $WinUtilScriptPath)).Groups[2].Value) - # If WinUtil has been modified since the last time it was launched, download a fresh copy of the script. + # Check if WinUtil needs an update and either download a fresh copy or notify the user its already up-to-date. if ([version]$RemoteWinUtilVersion -ne [version]$LocalWinUtilVersion) { Write-Host "WinUtil is out-of-date. Downloading WinUtil '$($RemoteWinUtilVersion)'..." -ForegroundColor DarkYellow Invoke-RestMethod $WinUtilReleaseURL -OutFile $WinUtilScriptPath - } - - # If WinUtil has not been modified, skip updating the script and let the user know it is already up-to-date. - if ([version]$RemoteWinUtilVersion -eq [version]$LocalWinUtilVersion) { + } else { Write-Host "WinUtil is already up-to-date. Skipped update checking." -ForegroundColor Yellow } }