Skip to content

Commit

Permalink
fix(local-build): open pb location OS compat
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jul 7, 2024
1 parent 69e1c31 commit 33a9194
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/local-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33a9194

Please sign in to comment.