From a4c6e9e7cda16c428219dcbc16b2bb4d2a3a3e3c Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Fri, 29 Nov 2019 00:41:29 +0100 Subject: [PATCH] fix: dev: small improvements !minor Signed-off-by: Valentin Lab --- bin/compose | 6 ++---- bin/compose-core | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/compose b/bin/compose index eaf5836..253e246 100755 --- a/bin/compose +++ b/bin/compose @@ -857,9 +857,7 @@ mk_docker_run_options() { clean_unused_sessions filename=$(mktemp -p /tmp/ -t launch_opts-XXXXXXXXXXXXXXXX) - { - p0 "${docker_run_opts[@]}" - } > "$filename" + p0 "${docker_run_opts[@]}" > "$filename" sha=$(sha256sum "$filename") sha=${sha:0:64} src="$SESSION_DIR/$UID-$sha" @@ -872,7 +870,7 @@ mk_docker_run_options() { mkdir -p "$SESSION_DIR" || return 1 mv -f "$filename" "$SESSION_DIR/$UID-$sha" || return 1 - echo "$SESSION_DIR/$UID-$sha" + e "$SESSION_DIR/$UID-$sha" if [ -n "$DEBUG" ]; then echo "${WHITE}Environment:${NORMAL}" diff --git a/bin/compose-core b/bin/compose-core index cfde9de..43f2d09 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -3202,9 +3202,9 @@ launch_docker_compose() { { { if [ -z "$COMPOSE_DISABLE_DOCKER_COMPOSE_STORE" ]; then - cd "/var/lib/compose/docker-compose/$sha/$project" + cd "/var/lib/compose/docker-compose/$sha/$project" || return 1 else - cd "$docker_compose_dir" + cd "$docker_compose_dir" || return 1 fi if [ -f ".env" ]; then debug "${WHITE}.env$NORMAL for $DARKYELLOW$SERVICE_PACK$NORMAL:" @@ -3222,7 +3222,7 @@ launch_docker_compose() { } | _save stdout } 3>&1 1>&2 2>&3 | _save stderr } 3>&1 1>&2 2>&3 - if tail -n 1 "$docker_compose_dir/.data/stderr" | egrep "Service .+ failed to build: Error getting container [0-9a-f]+ from driver devicemapper: (open|Error mounting) /dev/mapper/docker-.*: no such file or directory$" >/dev/null 2>&1; then + if tail -n 1 "$docker_compose_dir/.data/stderr" | grep -E "Service .+ failed to build: Error getting container [0-9a-f]+ from driver devicemapper: (open|Error mounting) /dev/mapper/docker-.*: no such file or directory$" >/dev/null 2>&1; then err "Detected bug https://github.com/docker/docker/issues/4036 ... " err "Please re-launch your command, or switch from 'devicemapper' driver to 'overlayfs' or 'aufs'." fi