Skip to content

Commit

Permalink
Fixes after testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rcknr committed Feb 5, 2024
1 parent a244212 commit cdce5e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docker-rollout
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ main() {
fi

# shellcheck disable=SC2086 # COMPOSE_FILES and ENV_FILES must be unquoted to allow multiple files
OLD_CONTAINER_IDS_STRING=$($COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES ps --quiet "$SERVICE" | tr '\n' '|')
OLD_CONTAINER_IDS_STRING=$($COMPOSE_COMMAND $COMPOSE_FILES $ENV_FILES ps --quiet "$SERVICE" | tr '\n' '|' | sed 's/|$//')
OLD_CONTAINER_IDS=$(echo "$OLD_CONTAINER_IDS_STRING" | tr '|' ' ')
SCALE=$(echo "$OLD_CONTAINER_IDS" | wc -w)
SCALE_TIMES_TWO=$((SCALE * 2))
Expand Down Expand Up @@ -173,9 +173,11 @@ while [ $# -gt 0 ]; do
exit_with_usage
;;
*)
if [ -n "$SERVICE" ] || [ "$SERVICE" != "$1" ]; then
if [ -n "$SERVICE" ]; then
echo "SERVICE is already set to '$SERVICE'"
exit_with_usage
if [ "$SERVICE" != "$1" ]; then
exit_with_usage
fi
fi

SERVICE="$1"
Expand Down

0 comments on commit cdce5e1

Please sign in to comment.