From 2cbbd8ce889860f431c79b0055ffa65a4251bf04 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Mon, 23 Mar 2026 13:36:59 -0700 Subject: [PATCH] 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) --- tests/codex-app-compat/test-environment-detection.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/codex-app-compat/test-environment-detection.sh b/tests/codex-app-compat/test-environment-detection.sh index 1de5c8f6..daee0398 100755 --- a/tests/codex-app-compat/test-environment-detection.sh +++ b/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)); }