fix(release): replace rsync with cp -RL for cross-environment portability

Linuxbrew CI ships without rsync, which broke the homebrew-core
formula build. cp -RL provides the same dereference-symlinks behavior
on both BSD and GNU coreutils, no extra dependency required.
This commit is contained in:
José Almeida
2026-05-17 20:15:55 +01:00
parent f6927d0589
commit 5599817f4f
+6 -13
View File
@@ -17,19 +17,12 @@ fi
rm -rf "$OUT_DIR"
mkdir -p "$OUT_DIR"
# Copy with symlinks dereferenced so pnpm's .pnpm/ structure survives
# archiving (symlinks cause issues on Windows even inside tar). The
# standalone output may contain broken symlinks from partial tracing —
# --safe-links skips those and rsync exits with code 23 (partial transfer),
# which is expected.
rsync -a --copy-links --safe-links "$WEB_DIR/.next/standalone/" "$OUT_DIR/" || {
rc=$?
if [ "$rc" -eq 23 ]; then
echo "Warning: some broken symlinks were skipped (expected for standalone output)"
else
exit "$rc"
fi
}
# Copy the standalone bundle with symlinks dereferenced so pnpm's
# .pnpm/ structure survives archiving (symlinks cause issues on
# Windows even inside tar). cp -RL ships with both BSD and GNU
# coreutils; rsync isn't present in Linuxbrew CI. The trailing `.` is
# the portable way to copy directory contents on both flavors.
cp -RL "$WEB_DIR/.next/standalone/." "$OUT_DIR/"
# pnpm's .pnpm virtual store keeps hoisted packages in
# node_modules/.pnpm/node_modules/ which is unreachable via normal Node
# module resolution from web/node_modules/next/. Copy everything into