Skip to content

Commit

Permalink
More verbose documentation with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
markshust authored Nov 22, 2023
1 parent fc3870d commit 10f07b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions compose/bin/docker-compose
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ fi

COMPOSE_FILES=("compose.yaml" "compose.healthcheck.yaml")

# If --no-dev is passed to this script, we won't load the compose.dev.yaml file,
# but this argument should be removed so it isn't passed to docker compose.
if [ "$1" == "--no-dev" ]; then
# ensure --no-dev parameter isn't passed to docker compose
# Remove the "--no-dev" argument so it isn't passed to docker compose
shift 1
else
# The "--no-dev" argument wasn't passed in, so let's load the dev config.
COMPOSE_FILES+=("compose.dev.yaml")
fi

# We create an array including files prefixed with -f here
# to ensure paths with spaces aren't split when passed as parameters
# Loop over the list of compose files, and prefix them with -f.
# This ensures paths with spaces aren't split when passed as parameters.
COMPOSE_FILES_PREFIXED=()
for file in "${COMPOSE_FILES[@]}"; do
COMPOSE_FILES_PREFIXED+=("-f" "$file")
Expand Down

0 comments on commit 10f07b7

Please sign in to comment.