Skip to content

Commit 01de407

Browse files
committed
fix(install.ps1): replace Write-Error+exit with throw in Die()
With $ErrorActionPreference='Stop', Write-Error throws immediately and exit 1 is dead code. More critically, exit 1 in an irm|iex session would close the user's interactive PowerShell window if it were reached. throw gives a clean single-line error message and is safe for embedded execution via irm|iex.
1 parent 62087c4 commit 01de407

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $Repo = 'q2'
3636
$Platform = 'windows_amd64'
3737
$UA = @{ 'User-Agent' = 'q2-install' }
3838

39-
function Die([string]$msg) { Write-Error "q2 install: $msg"; exit 1 }
39+
function Die([string]$msg) { throw "q2 install: $msg" }
4040
function Step([string]$msg) { Write-Host "-> $msg" }
4141

4242
# q2 ships an x86_64 Windows binary; ARM64 Windows runs it under

0 commit comments

Comments
 (0)