From 07bb0775fd08ab12174c678cc5f1b09e4623fcb4 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 20 Jun 2016 14:07:25 +0200 Subject: [PATCH] new: [up] force ``-d`` option. This will be required to allow special post-up scripts. --- bin/compose | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/compose b/bin/compose index 309b986..783cdbf 100755 --- a/bin/compose +++ b/bin/compose @@ -652,9 +652,7 @@ array_pop() { export -f array_pop array_member() { - local src elt - src="$1" - elt="$2" + local src="$1" elt="$2" while read-0 key; do if [ "$(eval "echo -n \"\${$src[\$key]}\"")" == "$elt" ]; then return 0 @@ -2487,6 +2485,10 @@ export SERVICE_PACK="$services" case "$action" in up|start|stop|build) master_services=$(get_master_services $SERVICE_PACK) || exit 1 + if [[ "$action" == "up" ]] && ! array_member action_opts -d; then ## force daemon mode for up + action_opts=("-d" "${action_opts[@]}") + fi + launch_docker_compose "${compose_opts[@]}" "$action" "${action_opts[@]}" $master_services ;; run)