From 952cdeaa75844f754c945fe3bd99a27171daa16d Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Tue, 3 Oct 2023 14:54:21 +0200 Subject: [PATCH] debug --- update/matchparser.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index 238b438..483d5f4 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -55,16 +55,21 @@ function get-killstats { } } # Get the latest file in the directory by last modification time -try { $latestFile = Get-ChildItem -Path "$scriptroot/../data/archive/" -File -ErrorAction Stop | Sort-Object LastWriteTime -Descending | Select-Object -First 1 } catch { +try { $latestFile = Get-ChildItem -Path "$scriptroot/../data/archive/" -File -ErrorAction Stop | Sort-Object LastWriteTime -Descending | Select-Object -First 1 +Write-Output "Found file $($latestFile.FullName)" + +} catch { $latestFile = @() } # Display the result if ($latestFile.FullName) { + write-host "getting info from $($latestFile.FullName)" $oldstats = get-content $latestFile.FullName | ConvertFrom-Json } else { + write-output 'setting old stats var empty' $oldstats = @() } -- 2.49.1