File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
registry/coder-labs/modules/archive Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -64,5 +64,12 @@ echo "Installed extract script to: $EXTRACT_WRAPPER_PATH"
6464if [[ $EXTRACT_ON_START = true ]]; then
6565 . " $LIB_PATH "
6666
67- archive_wait_and_extract " $EXTRACT_WAIT_TIMEOUT "
67+ archive_wait_and_extract " $EXTRACT_WAIT_TIMEOUT " quiet || {
68+ exit_code=$?
69+ if [[ $exit_code -eq 2 ]]; then
70+ echo " WARNING: Archive not found in backup path (this is expected with new workspaces)."
71+ else
72+ exit $exit_code
73+ fi
74+ }
6875fi
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -euo pipefail
33
4- # set -x
5-
64log () {
75 printf ' %s\n' " $@ " >&2
86}
@@ -253,6 +251,7 @@ archive_wait_and_extract() {
253251 load_defaults
254252
255253 local timeout=" ${1:- 300} "
254+ local quiet=" ${2:- } "
256255 local file=" ${DEFAULT_ARCHIVE_PATH} "
257256
258257 local start now
@@ -273,6 +272,8 @@ archive_wait_and_extract() {
273272 sleep 5
274273 done
275274
276- printf ' ERROR: Timed out waiting for archive: %s\n' " $file " >&2
277- return 1
275+ if [[ -z $quiet ]]; then
276+ printf ' ERROR: Timed out waiting for archive: %s\n' " $file " >&2
277+ fi
278+ return 2
278279}
You can’t perform that action at this time.
0 commit comments