fix(install): don't abort install.ps1 when git writes to stderr (#80834) · openclaw/openclaw@d06f0a0
sjf
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -568,8 +568,13 @@ function Install-OpenClawFromGit {
|
568 | 568 | } |
569 | 569 | |
570 | 570 | if (-not $SkipUpdate) { |
571 | | -if (-not (git -C $RepoDir status --porcelain 2>$null)) { |
572 | | - git -C $RepoDir pull --rebase 2>$null |
| 571 | +# PowerShell 7+ surfaces native-command stderr as terminating errors when |
| 572 | +# $ErrorActionPreference=Stop, so git's normal "From <url>" progress line |
| 573 | +# would abort the script. Swallow failures here — pull is best-effort. |
| 574 | +$dirty = $null |
| 575 | +try { $dirty = git -C $RepoDir status --porcelain 2>$null } catch {} |
| 576 | +if (-not $dirty) { |
| 577 | +try { git -C $RepoDir pull --rebase 2>$null } catch {} |
573 | 578 | } else { |
574 | 579 | Write-Host "[!] Repo is dirty; skipping git pull" -ForegroundColor Yellow |
575 | 580 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。