Skip to content

Commit

Permalink
Use -PassThru to correctly get status code and fix window closing.
Browse files Browse the repository at this point in the history
  • Loading branch information
d3nd3 committed May 3, 2023
1 parent 92a08b6 commit aaffa8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions http_listener.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Write-Host 'Keep this window open so that it can detect map change.'
Write-Host 'SoF should open automatically now.'

# Launch SoF
$gameProcess = Start-Process -FilePath 'SoF.exe' -ArgumentList "+set console 1"
$gameProcess = Start-Process -PassThru -FilePath 'SoF.exe' -ArgumentList "+set console 1"

While ($true) {
If (Test-Path $AFile) {
Expand Down Expand Up @@ -62,7 +62,8 @@ While ($true) {
# Wait for 2 seconds and check again
Start-Sleep -Seconds 2

if (!$gameProcess.HasExited) {
if ($gameProcess.HasExited) {
exit
}

}

0 comments on commit aaffa8f

Please sign in to comment.