Skip to content

Commit 6f34cbf

Browse files
authored
fix: Use double quotes for trap signal (#2956)
Frequently callers will wrap our shell script in `sh -c ''`. Having single quotes on our `trap` led to a syntax error when doing this.
1 parent 8b76e40 commit 6f34cbf

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

provisionersdk/scripts/bootstrap_darwin.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22
set -eux pipefail
3-
trap 'echo === Agent script exited with non-zero code. Sleeping 24h to preserve logs... && sleep 86400' EXIT
3+
trap "echo === Agent script exited with non-zero code. Sleeping 24h to preserve logs... && sleep 86400" EXIT
44
BINARY_DIR=$(mktemp -d -t coder.XXXXXX)
55
BINARY_NAME=coder
66
cd "$BINARY_DIR"

provisionersdk/scripts/bootstrap_linux.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env sh
22
set -eux pipefail
3-
# Not all instances of "trap" support ERR SIGNAL_SPEC. See: https://github.com/bmizerany/roundup/issues/25
4-
trap 'echo === Agent script exited with non-zero code. Sleeping 24h to preserve logs... && sleep 86400' EXIT || true
3+
trap "echo === Agent script exited with non-zero code. Sleeping 24h to preserve logs... && sleep 86400" EXIT
54
BINARY_DIR=$(mktemp -d -t coder.XXXXXX)
65
BINARY_NAME=coder
76
BINARY_URL=${ACCESS_URL}bin/coder-linux-${ARCH}

0 commit comments

Comments
 (0)