Переглянути джерело

fix(test): use single-quoted trap for safer cleanup (PRI-823)

Defers $TEMP_DIR expansion to execution time and quotes the variable
inside the trap, protecting against paths with spaces.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drew Ritter 5 місяців тому
батько
коміт
2cbbd8ce88
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      tests/codex-app-compat/test-environment-detection.sh

+ 1 - 1
tests/codex-app-compat/test-environment-detection.sh

@@ -8,7 +8,7 @@ set -euo pipefail
 PASS=0
 FAIL=0
 TEMP_DIR=$(mktemp -d)
-trap "rm -rf $TEMP_DIR" EXIT
+trap 'rm -rf "$TEMP_DIR"' EXIT
 
 log_pass() { echo "  PASS: $1"; PASS=$((PASS + 1)); }
 log_fail() { echo "  FAIL: $1"; FAIL=$((FAIL + 1)); }