Skip to content

Commit 36abb39

Browse files
#3327: update-assemblyinfo.ps1: Redirect stderr for commands that should ignore errors.
1 parent 09ed31d commit 36abb39

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

BuildTools/update-assemblyinfo.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ function gitVersion() {
5252
return 0;
5353
}
5454
try {
55-
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev;
55+
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD" 2>&1 | Tee-Object -Variable cmdOutput)) + $baseCommitRev;
5656
} catch {
57+
Write-Host $cmdOutput
5758
return 0;
5859
}
5960
}
@@ -63,8 +64,9 @@ function gitCommitHash() {
6364
return "0000000000000000000000000000000000000000";
6465
}
6566
try {
66-
return (git rev-list --max-count 1 HEAD);
67+
return (git rev-list --max-count 1 HEAD 2>&1 | Tee-Object -Variable cmdOutput);
6768
} catch {
69+
Write-Host $cmdOutput
6870
return "0000000000000000000000000000000000000000";
6971
}
7072
}
@@ -74,8 +76,9 @@ function gitShortCommitHash() {
7476
return "00000000";
7577
}
7678
try {
77-
return (git rev-parse --short=8 (git rev-list --max-count 1 HEAD));
79+
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);
7880
} catch {
81+
Write-Host $cmdOutput
7982
return "00000000";
8083
}
8184
}

0 commit comments

Comments
 (0)