Skip to content

Commit f6ae1bd

Browse files
committed
fix: define OPENBOOT_BIN before trap to prevent empty variable expansion
1 parent b92725f commit f6ae1bd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/hooks.server.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ echo " Config: @${username}/${slug}"
1010
echo "========================================"
1111
echo ""
1212
13+
TMPDIR="\${TMPDIR:-/tmp}"
14+
OPENBOOT_BIN="\$TMPDIR/openboot-\$\$"
15+
1316
echo "Some installations require admin privileges."
1417
sudo -v
1518
( while true; do sudo -n true; sleep 50; done ) 2>/dev/null &
16-
SUDO_KEEPALIVE_PID=$!
17-
trap "kill $SUDO_KEEPALIVE_PID 2>/dev/null; rm -f \\"\$OPENBOOT_BIN\\"" EXIT
19+
SUDO_KEEPALIVE_PID=\$!
20+
trap 'kill \$SUDO_KEEPALIVE_PID 2>/dev/null; rm -f "\$OPENBOOT_BIN"' EXIT
1821
1922
install_xcode_clt() {
2023
if xcode-select -p &>/dev/null; then
@@ -59,10 +62,6 @@ else
5962
fi
6063
6164
OPENBOOT_URL="https://github.com/openbootdotdev/openboot/releases/latest/download/openboot-darwin-\${ARCH}"
62-
TMPDIR="\${TMPDIR:-/tmp}"
63-
OPENBOOT_BIN="\$TMPDIR/openboot-\$\$"
64-
65-
6665
6766
echo "Downloading OpenBoot..."
6867
curl -fsSL "\$OPENBOOT_URL" -o "\$OPENBOOT_BIN"

0 commit comments

Comments
 (0)