Skip to content

Commit

Permalink
fix(local-build): killing old instances
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jul 1, 2024
1 parent 3abfbf4 commit 8e2da10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/local-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ while ($true) { Get-Content -Wait -LiteralPath $a -EA 0 | Write-Output; Start-Sl

# Kill old instances
# Would use SetForegroundWindow but it doesn't always work, so opening a new window is most reliable :/
((New-Object -Com Shell.Application).Windows() | Where-Object { $_.Document.Folder.Self.Path -eq "$(Split-Path -Path $apbxPath)" }).Quit()
$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"
}
Expand Down

0 comments on commit 8e2da10

Please sign in to comment.