diff --git a/Winget-AutoUpdate/functions/Test-Mods.ps1 b/Winget-AutoUpdate/functions/Test-Mods.ps1 index dba00a1..72abbd7 100644 --- a/Winget-AutoUpdate/functions/Test-Mods.ps1 +++ b/Winget-AutoUpdate/functions/Test-Mods.ps1 @@ -2,17 +2,18 @@ function Test-Mods ($app){ - if (Test-Path "$WorkingDir\mods\$app-install.ps1"){ - $ModsInstall = "$WorkingDir\mods\$app-install.ps1" - $ModsUpgrade = "$WorkingDir\mods\$app-install.ps1" + if (Test-Path "$WorkingDir\mods\$app-*"){ + if (Test-Path "$WorkingDir\mods\$app-install.ps1"){ + $ModsInstall = "$WorkingDir\mods\$app-install.ps1" + $ModsUpgrade = "$WorkingDir\mods\$app-install.ps1" + } + if (Test-Path "$WorkingDir\mods\$app-upgrade.ps1"){ + $ModsUpgrade = "$WorkingDir\mods\$app-upgrade.ps1" + } + return $ModsInstall,$ModsUpgrade } - if (Test-Path "$WorkingDir\mods\$app-upgrade.ps1"){ - $ModsUpgrade = "$WorkingDir\mods\$app-upgrade.ps1" - } - else{ + else { return 0 } - return $ModsInstall,$ModsUpgrade - } \ No newline at end of file diff --git a/Winget-AutoUpdate/functions/Update-WAU.ps1 b/Winget-AutoUpdate/functions/Update-WAU.ps1 index 74b7018..c46c9d2 100644 --- a/Winget-AutoUpdate/functions/Update-WAU.ps1 +++ b/Winget-AutoUpdate/functions/Update-WAU.ps1 @@ -31,10 +31,6 @@ function Update-WAU { $TempPath = (Resolve-Path "$location\*\Winget-AutoUpdate\")[0].Path if ($TempPath){ Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force - #Add 'mods' directory - if (!(Test-Path "$WorkingDir\mods")){ - New-Item -ItemType Directory -Force -Path "$WingetUpdatePath\mods" - } } #Remove update zip file and update temp folder