From 33a9194f7101f2433714991fb4b5b22e8bbc652d Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Sun, 7 Jul 2024 15:51:11 +0100 Subject: [PATCH] fix(local-build): open pb location OS compat --- src/local-build.ps1 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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