Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions deva.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3950,8 +3950,12 @@ if [ "$EPHEMERAL_MODE" = false ]; then
else
# Container doesn't exist - try to create it
echo "Creating persistent container: $CONTAINER_NAME"
error_output=$(docker "${DOCKER_ARGS[@]}" tail -f /dev/null 2>&1)
docker_exit=$?
# `|| docker_exit=$?` is load-bearing: under `set -e` a failing
# command-substitution assignment aborts the script AT the assignment,
# so the error handling below would be dead code on the exact path it
# exists for. Keep the assignment left of `||` to suspend `set -e`.
docker_exit=0
error_output=$(docker "${DOCKER_ARGS[@]}" tail -f /dev/null 2>&1) || docker_exit=$?
if [ $docker_exit -ne 0 ]; then
# Check if specifically a name collision (concurrent run)
if echo "$error_output" | grep -qE 'already in use|Conflict'; then
Expand Down
Loading