File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 6
6
DOCKER_COMPOSE=" docker-compose"
7
7
fi
8
8
9
+ COMPOSE_FILES=(" compose.yaml" " compose.healthcheck.yaml" )
10
+
11
+ # If --no-dev is passed to this script, we won't load the compose.dev.yaml file,
12
+ # but this argument should be removed so it isn't passed to docker compose.
9
13
if [ " $1 " == " --no-dev" ]; then
10
- ${DOCKER_COMPOSE} -f compose.yaml -f compose.healthcheck.yaml " ${@: 2} "
14
+ # Remove the "--no-dev" argument so it isn't passed to docker compose
15
+ shift 1
11
16
else
12
- ${DOCKER_COMPOSE} -f compose.yaml -f compose.healthcheck.yaml -f compose.dev.yaml " $@ "
17
+ # The "--no-dev" argument wasn't passed in, so let's load the dev config.
18
+ COMPOSE_FILES+=(" compose.dev.yaml" )
13
19
fi
20
+
21
+ # Loop over the list of compose files, and prefix them with -f.
22
+ # This ensures paths with spaces aren't split when passed as parameters.
23
+ COMPOSE_FILES_PREFIXED=()
24
+ for file in " ${COMPOSE_FILES[@]} " ; do
25
+ COMPOSE_FILES_PREFIXED+=(" -f" " $file " )
26
+ done
27
+
28
+ ${DOCKER_COMPOSE} " ${COMPOSE_FILES_PREFIXED[@]} " " $@ "
You can’t perform that action at this time.
0 commit comments