From 7360cec929fa5c4907700818e761868cdd536d3c Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 7 Nov 2019 22:31:51 +0900 Subject: [PATCH] Gracefully fail if build.sh fail --- btcpay-setup.sh | 7 ++++++- btcpay-update.sh | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/btcpay-setup.sh b/btcpay-setup.sh index 8d14a06..33e69c4 100755 --- a/btcpay-setup.sh +++ b/btcpay-setup.sh @@ -450,7 +450,12 @@ if $HAS_DOCKER; then fi # Generate the docker compose in BTCPAY_DOCKER_COMPOSE -$HAS_DOCKER && . ./build.sh +if $HAS_DOCKER; then + if ! ./build.sh; then + echo "Failed to generate the docker-compose" + return + fi +fi if [[ "$BTCPAYGEN_OLD_PREGEN" == "true" ]]; then cp Generated/docker-compose.generated.yml $BTCPAY_DOCKER_COMPOSE diff --git a/btcpay-update.sh b/btcpay-update.sh index 40b8634..b47c915 100755 --- a/btcpay-update.sh +++ b/btcpay-update.sh @@ -38,9 +38,12 @@ if ! [ -f "/etc/docker/daemon.json" ] && [ -w "/etc/docker" ]; then }" > /etc/docker/daemon.json echo "Setting limited log files in /etc/docker/daemon.json" fi -set -e -. ./build.sh -set +e + +if ! ./build.sh; then + echo "Failed to generate the docker-compose" + exit 1 +fi + if [ "$BTCPAYGEN_OLD_PREGEN" == "true" ]; then cp Generated/docker-compose.generated.yml $BTCPAY_DOCKER_COMPOSE cp Generated/torrc.tmpl "$(dirname "$BTCPAY_DOCKER_COMPOSE")/torrc.tmpl"