aboutsummaryrefslogtreecommitdiff
path: root/test/apps/bun-run-check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/apps/bun-run-check.sh')
-rw-r--r--test/apps/bun-run-check.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/apps/bun-run-check.sh b/test/apps/bun-run-check.sh
index dca1db6ae..decfb2896 100644
--- a/test/apps/bun-run-check.sh
+++ b/test/apps/bun-run-check.sh
@@ -1,6 +1,8 @@
#!/bin/bash
-(killall -9 $(basename $BUN_BIN) || echo "") >/dev/null 2>&1
+set -euo pipefail
+
+(killall -9 "$(basename "$BUN_BIN")" || echo "") >/dev/null 2>&1
# https://github.com/Jarred-Sumner/bun/issues/40
# Define a function (details aren't important)
@@ -8,11 +10,10 @@ fn() { :; }
# The important bit: export the function
export -f fn
-rm -rf /tmp/bun-run-check
-mkdir -p /tmp/bun-run-check
+DIR=$(mktemp -d -t bun-run-check)
-cp ./bun-run-check-package.json /tmp/bun-run-check/package.json
-cd /tmp/bun-run-check
+cp ./bun-run-check-package.json "$DIR/package.json"
+cd "$DIR"
$BUN_BIN run bash -- -c ""
@@ -22,12 +23,12 @@ if (($?)); then
fi
# https://github.com/Jarred-Sumner/bun/issues/53
-rm -f /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt >/dev/null 2>&1
+rm -f "$DIR/bun-run-out.expected.txt" "$DIR/bun-run-out.txt" >/dev/null 2>&1
-$BUN_BIN run --silent argv -- foo bar baz >/tmp/bun-run-out.txt
-npm run --silent argv -- foo bar baz >/tmp/bun-run-out.expected.txt
+$BUN_BIN run --silent argv -- foo bar baz > "$DIR/bun-run-out.txt"
+npm run --silent argv -- foo bar baz > "$DIR/bun-run-out.expected.txt"
-cmp -s /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt
+cmp -s "$DIR/bun-run-out.expected.txt" "$DIR/bun-run-out.txt"
if (($?)); then
echo "argv failed"
exit 1