Skip to content

Commit

Permalink
Guard against compose versions that delete all containers on rm with …
Browse files Browse the repository at this point in the history
…no arguments
  • Loading branch information
andytson-inviqa committed Mar 24, 2023
1 parent fbef07c commit b8d7afa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/_base/harness/scripts/enable.sh.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ enable_all()
if [ "$HAS_FLAG" = no ]; then
# remove all services, keeping console if considered built
if console_enabled; then
passthru "${COMPOSE_BIN[*]} ps --services | grep -v -Fxe console | xargs ${COMPOSE_BIN[*]} rm --force --stop --"
if [ -n "$("${COMPOSE_BIN[@]}" ps --services | grep -v -Fxe console)" ]; then
passthru "${COMPOSE_BIN[*]} ps --services | grep -v -Fxe console | xargs ${COMPOSE_BIN[*]} rm --force --stop --"
fi
else
passthru "${COMPOSE_BIN[@]}" down
fi
Expand Down

0 comments on commit b8d7afa

Please sign in to comment.