fix(ci): link Windows hydrate node modules

This commit is contained in:
Vincent Koc
2026-06-01 08:38:22 +02:00
parent 01124cfca9
commit ddbd595f2f
2 changed files with 13 additions and 0 deletions

View File

@@ -431,6 +431,16 @@ jobs:
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
$workspaceNodeModules = Join-Path $workspace "node_modules"
if (Test-Path $workspaceNodeModules) {
$workspaceNodeModulesItem = Get-Item $workspaceNodeModules -Force
if (($workspaceNodeModulesItem.Attributes -band [System.IO.FileAttributes]::ReparsePoint) -eq 0) {
throw "workspace node_modules exists and is not a link: $workspaceNodeModules"
}
} else {
New-Item -ItemType Junction -Path $workspaceNodeModules -Target $env:PNPM_CONFIG_MODULES_DIR | Out-Null
}
$corepackShimDir = Join-Path $nodeBin "node_modules\corepack\shims"
if (Test-Path $corepackShimDir) {
$env:PNPM_HOME = $corepackShimDir