Skip to content

Commit

Permalink
#3327: update-assemblyinfo.ps1: Redirect stderr for commands that sho…
Browse files Browse the repository at this point in the history
…uld ignore errors.
  • Loading branch information
siegfriedpammer committed Nov 16, 2024
1 parent 09ed31d commit 36abb39
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions BuildTools/update-assemblyinfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ function gitVersion() {
return 0;
}
try {
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev;
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD" 2>&1 | Tee-Object -Variable cmdOutput)) + $baseCommitRev;
} catch {
Write-Host $cmdOutput
return 0;
}
}
Expand All @@ -63,8 +64,9 @@ function gitCommitHash() {
return "0000000000000000000000000000000000000000";
}
try {
return (git rev-list --max-count 1 HEAD);
return (git rev-list --max-count 1 HEAD 2>&1 | Tee-Object -Variable cmdOutput);
} catch {
Write-Host $cmdOutput
return "0000000000000000000000000000000000000000";
}
}
Expand All @@ -74,8 +76,9 @@ function gitShortCommitHash() {
return "00000000";
}
try {
return (git rev-parse --short=8 (git rev-list --max-count 1 HEAD));
return (git rev-parse --short=8 (git rev-list --max-count 1 HEAD 2>&1 | Tee-Object -Variable cmdOutput) 2>&1 | Tee-Object -Variable cmdOutput);
} catch {
Write-Host $cmdOutput
return "00000000";
}
}
Expand Down

0 comments on commit 36abb39

Please sign in to comment.