From 344977802eb1b3d62e9bd12d822f1e786c86de0a Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Fri, 7 Dec 2018 21:17:23 +0100 Subject: [PATCH] new: ``compose up`` now includes ``--remove-orphans`` by default. --- bin/compose-core | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/compose-core b/bin/compose-core index c0dcaf5..f081d31 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -3661,10 +3661,14 @@ export SERVICE_PACK="${services_args[*]}" case "$action" in up|start|stop|build|run) ## force daemon mode for up - if [[ "$action" == "up" ]] && ! array_member action_opts -d; then - action_opts+=("-d") + if [[ "$action" == "up" ]]; then + if ! array_member action_opts -d; then + action_opts+=("-d") + fi + if ! array_member action_opts --remove-orphans; then + action_opts+=("--remove-orphans") + fi fi - launch_docker_compose "${compose_opts[@]}" "$action" "${action_opts[@]}" "${action_posargs[@]}" "${remainder_args[@]}" ;; logs)