diff --git a/src/local-build.ps1 b/src/local-build.ps1 index c16bdccaa2..ecae38cbfa 100644 --- a/src/local-build.ps1 +++ b/src/local-build.ps1 @@ -148,15 +148,14 @@ while ($true) { Get-Content -Wait -LiteralPath $a -EA 0 | Write-Output; Start-Sl if (!$DontOpenPbLocation) { if ($IsLinux -or $IsMacOS) { Write-Warning "Can't open to APBX directory as the system isn't Windows." - break - } - - # Kill old instances - # Would use SetForegroundWindow but it doesn't always work, so opening a new window is most reliable :/ - $openWindows = ((New-Object -Com Shell.Application).Windows() | Where-Object { $_.Document.Folder.Self.Path -eq "$(Split-Path -Path $apbxPath)" }) - if ($openWindows.Count -ne 0) { $openWindows.Quit() } + } else { + # Kill old instances + # Would use SetForegroundWindow but it doesn't always work, so opening a new window is most reliable :/ + $openWindows = ((New-Object -Com Shell.Application).Windows() | Where-Object { $_.Document.Folder.Self.Path -eq "$(Split-Path -Path $apbxPath)" }) + if ($openWindows.Count -ne 0) { $openWindows.Quit() } - explorer /select,"$apbxPath" + explorer /select,"$apbxPath" + } } } finally { Remove-Item $rootTemp -Force -EA 0 -Recurse | Out-Null