mirror of
https://github.com/obra/superpowers.git
synced 2026-04-16 02:02:41 +00:00
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>
This commit is contained in:
@@ -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)); }
|
||||
|
||||
Reference in New Issue
Block a user