From d06f0a0ee78da48ab8ee88467ad5347fef152c57 Mon Sep 17 00:00:00 2001 From: Sarah Fortune Date: Tue, 12 May 2026 17:26:30 -0700 Subject: [PATCH] fix(install): don't abort install.ps1 when git writes to stderr (#80834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PowerShell 7+ honors $ErrorActionPreference=Stop for native commands, so git's normal progress line ("From https://...") on stderr during `git pull --rebase` would turn into a terminating error and abort the installer immediately after a fresh clone — before pnpm install/build ever runs. The existing `2>$null` redirects the display but the error record is still generated. Wrap the git status / pull calls in try/catch so the pull stays best-effort and the rest of the installer can proceed. Reproduced on Windows 11 ARM under PowerShell 7.x with -InstallMethod git. --- scripts/install.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 5b44720870b..0e87a04db73 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -568,8 +568,13 @@ function Install-OpenClawFromGit { } if (-not $SkipUpdate) { - if (-not (git -C $RepoDir status --porcelain 2>$null)) { - git -C $RepoDir pull --rebase 2>$null + # PowerShell 7+ surfaces native-command stderr as terminating errors when + # $ErrorActionPreference=Stop, so git's normal "From " progress line + # would abort the script. Swallow failures here — pull is best-effort. + $dirty = $null + try { $dirty = git -C $RepoDir status --porcelain 2>$null } catch {} + if (-not $dirty) { + try { git -C $RepoDir pull --rebase 2>$null } catch {} } else { Write-Host "[!] Repo is dirty; skipping git pull" -ForegroundColor Yellow }