Skip to content

Commit cd43120

Browse files
authored
Merge pull request #489 from thevibeworks/fix/silent-exit-bad-mount
fix: surface docker's error when it rejects a .deva mount
2 parents 5776806 + 711005f commit cd43120

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

deva.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3950,8 +3950,12 @@ if [ "$EPHEMERAL_MODE" = false ]; then
39503950
else
39513951
# Container doesn't exist - try to create it
39523952
echo "Creating persistent container: $CONTAINER_NAME"
3953-
error_output=$(docker "${DOCKER_ARGS[@]}" tail -f /dev/null 2>&1)
3954-
docker_exit=$?
3953+
# `|| docker_exit=$?` is load-bearing: under `set -e` a failing
3954+
# command-substitution assignment aborts the script AT the assignment,
3955+
# so the error handling below would be dead code on the exact path it
3956+
# exists for. Keep the assignment left of `||` to suspend `set -e`.
3957+
docker_exit=0
3958+
error_output=$(docker "${DOCKER_ARGS[@]}" tail -f /dev/null 2>&1) || docker_exit=$?
39553959
if [ $docker_exit -ne 0 ]; then
39563960
# Check if specifically a name collision (concurrent run)
39573961
if echo "$error_output" | grep -qE 'already in use|Conflict'; then

0 commit comments

Comments
 (0)