Skip to content

Commit 1e75794

Browse files
committed
fix: move nested node_modules removal to after zip but before Inno Setup\n\nThe zip archive retains all files (complete package).\nNested node_modules are removed only before Inno Setup to avoid\nWindows MAX_PATH (260 char) errors with deeply nested paths like\nopenclaw-zh/dist/extensions/discord/node_modules/@buape/carbon/...
1 parent f79f00c commit 1e75794

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,23 @@ jobs:
261261
Get-ChildItem output
262262
263263
# ===== Inno Setup installer (Windows only) =====
264+
# Remove deeply nested node_modules AFTER zip is created but BEFORE Inno Setup,
265+
# to avoid MAX_PATH (260 char) errors. The zip archive retains all files.
266+
- name: Flatten nested node_modules for Inno Setup
267+
if: runner.os == 'Windows'
268+
shell: pwsh
269+
run: |
270+
$nmDir = "build/${{ matrix.platform }}/node_modules"
271+
foreach ($pkgPath in @("$nmDir\@qingchencloud\openclaw-zh", "$nmDir\openclaw")) {
272+
if (Test-Path $pkgPath) {
273+
$nested = Get-ChildItem -Path $pkgPath -Directory -Filter "node_modules" -Recurse -ErrorAction SilentlyContinue
274+
if ($nested) {
275+
Write-Host "Removing $($nested.Count) nested node_modules dirs inside $(Split-Path $pkgPath -Leaf) for Inno Setup"
276+
$nested | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
277+
}
278+
}
279+
}
280+
264281
- name: Build Inno Setup installer
265282
if: runner.os == 'Windows'
266283
shell: pwsh

0 commit comments

Comments
 (0)