From 4e2c2b5c33cae42f11f86c5d326279dc26a51678 Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Mon, 12 Dec 2022 02:18:08 +0100 Subject: [PATCH] Moved *_error.txt to logs --- Winget-AutoUpdate/User-Run.ps1 | 2 +- Winget-AutoUpdate/Winget-Upgrade.ps1 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Winget-AutoUpdate/User-Run.ps1 b/Winget-AutoUpdate/User-Run.ps1 index c7c3583..0c79cfe 100644 --- a/Winget-AutoUpdate/User-Run.ps1 +++ b/Winget-AutoUpdate/User-Run.ps1 @@ -83,7 +83,7 @@ else { } #Test if there was a list_/winget_error - if (Test-Path "$WorkingDir\*_error.txt") { + if (Test-Path "$WorkingDir\logs\*_error.txt") { $MessageType = "error" } else { diff --git a/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Winget-AutoUpdate/Winget-Upgrade.ps1 index 7b9c9af..3bd3094 100644 --- a/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -72,8 +72,8 @@ if (Test-Network) { } #Delete previous list_/winget_error (if they exist) if System - if (Test-Path "$WorkingDir\*_error.txt") { - Remove-Item "$WorkingDir\*_error.txt" -Force + if (Test-Path "$WorkingDir\logs\*_error.txt") { + Remove-Item "$WorkingDir\logs\*_error.txt" -Force } #Get External ListPath if System @@ -89,7 +89,7 @@ if (Test-Network) { } else { Write-Log "Critical: List doesn't exist, exiting..." "Red" - New-Item "$WorkingDir\list_error.txt" -Force + New-Item "$WorkingDir\logs\list_error.txt" -Force Exit 1 } } @@ -135,7 +135,7 @@ if (Test-Network) { if ($outdated -like "Problem:*") { Write-Log "An error occured, exiting..." "red" Write-Log "$outdated" "red" - New-Item "$WorkingDir\winget_error.txt" -Value "$outdated" -Force + New-Item "$WorkingDir\logs\winget_error.txt" -Value "$outdated" -Force Exit 1 }