Skip to content

Commit

Permalink
Aways download if LastWriteTime not there
Browse files Browse the repository at this point in the history
  • Loading branch information
KnifMelti committed Aug 31, 2024
1 parent 87d00d3 commit ab50fc5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 7 additions & 1 deletion Sources/WAU/Winget-AutoUpdate/Winget-Upgrade.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,13 @@ if (Test-Network) {
$Script:ReachNoPath = $False
}
if ($NewList) {
Write-ToLog "Newer List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "Yellow"
if ($AlwaysDownloaded) {
Write-ToLog "List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "Yellow"
}
else {
Write-ToLog "Newer List downloaded/copied to local path: $($WAUConfig.InstallLocation.TrimEnd(" ", "\"))" "Yellow"
}
$Script:AlwaysDownloaded = $False
}
else {
if ($WAUConfig.WAU_UseWhiteList -and (Test-Path "$WorkingDir\included_apps.txt")) {
Expand Down
14 changes: 4 additions & 10 deletions Sources/WAU/Winget-AutoUpdate/functions/Test-ListPath.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,9 @@ function Test-ListPath ($ListPath, $UseWhiteList, $WingetUpdatePath) {
}
catch {
try {
$content = $wc.DownloadString("$ExternalList")
if ($null -ne $content -and $content -match "\w\.\w") {
$wc.DownloadFile($ExternalList, $LocalList)
return $true
}
else {
$Script:ReachNoPath = $True
return $False
}
$wc.DownloadFile($ExternalList, $LocalList)
$Script:AlwaysDownloaded = $True
return $true
}
catch {
$Script:ReachNoPath = $True
Expand Down Expand Up @@ -93,7 +87,7 @@ function Test-ListPath ($ListPath, $UseWhiteList, $WingetUpdatePath) {
}
else {
$Script:ReachNoPath = $True
return $False
}
return $False
}
}

0 comments on commit ab50fc5

Please sign in to comment.