fix: Force trap to always succeed due to incompatibility (#2953)

There are some instances of Linux that don't support trap. We should
ignore the failure in those cases.
This commit is contained in:
Kyle Carberry
2022-07-12 18:31:25 -05:00
committed by GitHub
parent 5ee112bc00
commit dde51f1caa

View File

@ -1,6 +1,7 @@
#!/usr/bin/env sh
set -eux pipefail
trap 'echo === Agent script exited with non-zero code. Sleeping 24h to preserve logs... && sleep 86400' EXIT
# 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 || true
BINARY_DIR=$(mktemp -d -t coder.XXXXXX)
BINARY_NAME=coder
BINARY_URL=${ACCESS_URL}bin/coder-linux-${ARCH}