fix(ci): tolerate pnpm workspace state on Windows hydrate · openclaw/openclaw@3322212
vincentkoc
·
2026-06-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -435,7 +435,16 @@ jobs:
|
435 | 435 | if (Test-Path $workspaceNodeModules) { |
436 | 436 | $workspaceNodeModulesItem = Get-Item $workspaceNodeModules -Force |
437 | 437 | if (($workspaceNodeModulesItem.Attributes -band [System.IO.FileAttributes]::ReparsePoint) -eq 0) { |
438 | | - throw "workspace node_modules exists and is not a link: $workspaceNodeModules" |
| 438 | + $nodeModulesChildren = @(Get-ChildItem -LiteralPath $workspaceNodeModules -Force) |
| 439 | + $hasOnlyPnpmWorkspaceState = $nodeModulesChildren.Count -eq 1 -and $nodeModulesChildren[0].Name -eq ".pnpm-workspace-state-v1.json" |
| 440 | + if ($nodeModulesChildren.Count -ne 0 -and -not $hasOnlyPnpmWorkspaceState) { |
| 441 | + throw "workspace node_modules exists and is not a link: $workspaceNodeModules" |
| 442 | + } |
| 443 | + foreach ($nodeModulesChild in $nodeModulesChildren) { |
| 444 | + Remove-Item -LiteralPath $nodeModulesChild.FullName -Force |
| 445 | + } |
| 446 | + Remove-Item -LiteralPath $workspaceNodeModules -Force |
| 447 | + New-Item -ItemType Junction -Path $workspaceNodeModules -Target $env:PNPM_CONFIG_MODULES_DIR | Out-Null |
439 | 448 | } |
440 | 449 | } else { |
441 | 450 | New-Item -ItemType Junction -Path $workspaceNodeModules -Target $env:PNPM_CONFIG_MODULES_DIR | Out-Null |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -181,6 +181,7 @@ describe("package acceptance workflow", () => {
|
181 | 181 | expect(hydrateWindowsPnpm.run).toContain( |
182 | 182 | 'New-Item -ItemType Junction -Path $workspaceNodeModules -Target $env:PNPM_CONFIG_MODULES_DIR', |
183 | 183 | ); |
| 184 | +expect(hydrateWindowsPnpm.run).toContain(".pnpm-workspace-state-v1.json"); |
184 | 185 | expect(hydrateWindowsPnpm.run).not.toContain("Remove-Item -Recurse -Force"); |
185 | 186 | expect(hydrateWindowsPnpm.run).not.toContain("Add-Content -Path $env:GITHUB_ENV"); |
186 | 187 | expect(hydrateWindowsPnpm.run).not.toContain("Add-Content -Path $env:GITHUB_PATH"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。