Skip to content

Commit

Permalink
Make gpg write log output to stdout in PowerShell
Browse files Browse the repository at this point in the history
gpg by default writes to stderr which is treated as "an error occurred"
by PowerShell. Hence write log output to stdout (FD 1) too.
  • Loading branch information
Flamefire committed May 6, 2022
1 parent 69fc160 commit 815b0a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ci/codecov.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ if (Get-Command "gpg.exe" -ErrorAction SilentlyContinue){
Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe.SHA256SUM.sig -Outfile codecov.exe.SHA256SUM.sig

$ErrorActionPreference = "Continue"
gpg.exe --import codecov.asc
gpg.exe --logger-fd 1 --import codecov.asc
if ($LASTEXITCODE -ne 0) { Throw "Importing the key failed." }
gpg.exe --verify codecov.exe.SHA256SUM.sig codecov.exe.SHA256SUM
gpg.exe --logger-fd 1 --verify codecov.exe.SHA256SUM.sig codecov.exe.SHA256SUM
if ($LASTEXITCODE -ne 0) { Throw "Signature validation of the SHASUM failed." }
If ($(Compare-Object -ReferenceObject $(($(certUtil -hashfile codecov.exe SHA256)[1], "codecov.exe") -join " ") -DifferenceObject $(Get-Content codecov.exe.SHA256SUM)).length -eq 0) {
echo "SHASUM verified"
Expand Down

0 comments on commit 815b0a1

Please sign in to comment.