Skip to content

Commit 90fb75a

Browse files
author
FallingAKS
committed
fix(release): handle git stderr output without aborting
1 parent 761b52a commit 90fb75a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/release-tag.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ if ($PSVersionTable.PSVersion.Major -ge 7) {
2020

2121
function Invoke-GitText {
2222
param([string[]]$GitArgs)
23-
$output = @(& git @GitArgs 2>&1)
24-
$exitCode = $LASTEXITCODE
23+
$originalErrorAction = $ErrorActionPreference
24+
try {
25+
$ErrorActionPreference = "Continue"
26+
$output = @(& git @GitArgs 2>&1)
27+
$exitCode = $LASTEXITCODE
28+
}
29+
finally {
30+
$ErrorActionPreference = $originalErrorAction
31+
}
2532
if ($null -eq $exitCode) { $exitCode = 0 }
2633
return [pscustomobject]@{
2734
exitCode = [int]$exitCode

0 commit comments

Comments
 (0)