mirror of
https://github.com/coder/coder.git
synced 2025-07-30 22:19:53 +00:00
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.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
set -eux pipefail
|
set -eux pipefail
|
||||||
trap 'echo === Agent script exited with non-zero code. Sleeping 24h to preserve logs... && sleep 86400' EXIT
|
trap "echo === Agent script exited with non-zero code. Sleeping 24h to preserve logs... && sleep 86400" EXIT
|
||||||
BINARY_DIR=$(mktemp -d -t coder.XXXXXX)
|
BINARY_DIR=$(mktemp -d -t coder.XXXXXX)
|
||||||
BINARY_NAME=coder
|
BINARY_NAME=coder
|
||||||
cd "$BINARY_DIR"
|
cd "$BINARY_DIR"
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
set -eux pipefail
|
set -eux pipefail
|
||||||
# Not all instances of "trap" support ERR SIGNAL_SPEC. See: https://github.com/bmizerany/roundup/issues/25
|
trap "echo === Agent script exited with non-zero code. Sleeping 24h to preserve logs... && sleep 86400" EXIT
|
||||||
trap 'echo === Agent script exited with non-zero code. Sleeping 24h to preserve logs... && sleep 86400' EXIT || true
|
|
||||||
BINARY_DIR=$(mktemp -d -t coder.XXXXXX)
|
BINARY_DIR=$(mktemp -d -t coder.XXXXXX)
|
||||||
BINARY_NAME=coder
|
BINARY_NAME=coder
|
||||||
BINARY_URL=${ACCESS_URL}bin/coder-linux-${ARCH}
|
BINARY_URL=${ACCESS_URL}bin/coder-linux-${ARCH}
|
||||||
|
Reference in New Issue
Block a user