$ErrorActionPreference = 'Continue'

$repo = Join-Path $env:USERPROFILE 'TibiaPilotNG'
$result = 'C:\ProgramData\TibiaPilotNG\coordinate-match.json'
$log = 'C:\ProgramData\TibiaPilotNG\coordinate-match.log'
Set-Location $repo
Remove-Item $result -Force -ErrorAction SilentlyContinue
Remove-Item $log -Force -ErrorAction SilentlyContinue
& '.\.venv\Scripts\python.exe' 'tools\Coordinate-Match-Diagnostic.py' *> $log
exit $LASTEXITCODE
