Skip to content

Commit 6f34cbf

Browse files
authored
fix: Use double quotes for trap signal (coder#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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy