Skip to content

Commit a335e31

Browse files
committed
fix(release): handle tar failures properly in strict mode
Disable errexit temporarily around tar pipe to allow proper fallback to cp+rm when tar fails. In strict mode (set -euo pipefail), pipe failures would exit the function before the fallback could execute. Changes: - Wrap tar command with set +e / set -e - Capture tar exit status explicitly - Check status and fallback to cp if needed This fixes intermittent sandbox test failures in strict parallel mode while maintaining the performance benefit of tar on systems where it works.
1 parent 5eda18e commit a335e31

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

release.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,19 @@ function release::sandbox::create() {
376376

377377
# Copy repo content excluding .git, .release-state, node_modules
378378
# Try tar pipe first (faster), fallback to cp + rm for portability
379-
if tar --exclude='.git' \
379+
# Disable errexit temporarily to allow tar fallback in strict mode
380+
local tar_status=0
381+
set +e
382+
tar --exclude='.git' \
380383
--exclude='.release-state' \
381384
--exclude='node_modules' \
382385
--exclude='.tasks' \
383386
--exclude='tmp' \
384-
-cf - . 2>/dev/null | tar -xf - -C "$SANDBOX_DIR" 2>/dev/null; then
387+
-cf - . 2>/dev/null | tar -xf - -C "$SANDBOX_DIR" 2>/dev/null
388+
tar_status=$?
389+
set -e
390+
391+
if [ "$tar_status" -eq 0 ]; then
385392
release::log_verbose "Copied project files to sandbox (tar)"
386393
else
387394
# Fallback: traditional cp + rm for maximum portability

0 commit comments

Comments
 (0)