Skip to content

Commit 20ea450

Browse files
committed
Fix ps install
1 parent 2e40d80 commit 20ea450

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

install.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,19 @@ New-Item -ItemType Directory -Path $tempDir -Force | Out-Null
115115

116116
try {
117117
Write-Info "Cloning coderaft repository..."
118-
git clone --depth 1 https://github.com/itzcozi/coderaft.git (Join-Path $tempDir "coderaft-src") 2>&1 | Out-Null
119-
if ($LASTEXITCODE -ne 0) {
118+
$srcDir = Join-Path $tempDir "coderaft-src"
119+
# Temporarily allow errors so git's stderr progress output doesn't throw
120+
$prevErrorAction = $ErrorActionPreference
121+
$ErrorActionPreference = 'Continue'
122+
$null = git clone --depth 1 https://github.com/itzcozi/coderaft.git $srcDir 2>&1
123+
$cloneExitCode = $LASTEXITCODE
124+
$ErrorActionPreference = $prevErrorAction
125+
if ($cloneExitCode -ne 0) {
120126
Write-Err "Failed to clone repository."
121127
exit 1
122128
}
123129

124-
Push-Location (Join-Path $tempDir "coderaft-src")
130+
Push-Location $srcDir
125131
try {
126132
Write-Info "Building coderaft..."
127133
$env:CGO_ENABLED = "0"

0 commit comments

Comments
 (0)