From cbf2caa4c3921b21bc5138cf85bcb2e0b112c819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Sat, 3 Mar 2018 21:59:34 +0100 Subject: [PATCH] Improve magic startup script --- tfw_magic_start.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tfw_magic_start.sh b/tfw_magic_start.sh index 30af1e2..09c2580 100755 --- a/tfw_magic_start.sh +++ b/tfw_magic_start.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e +[ -z $TAO_PATH ] && echo 'You need to set the "TAO_PATH" envvar to the directory where the TFW repos are cloned!' && exit 1 + BACKEND_REPO="${BACKEND_REPO:-tutorial-framework-wip}" FRONTEND_REPO="${FRONTEND_REPO:-tutorial-framework-ng}" BACKEND_PATH="${TAO_PATH}/${BACKEND_REPO}" @@ -23,6 +25,7 @@ function run_backend() docker run --rm -p $BACKEND_PORT:$BACKEND_PORT -e AVATAO_SECRET=$AVATAO_SECRET $IMAGE_NAME } -trap 'kill %1; kill %2' SIGINT +trap 'exit' INT TERM +trap 'kill 0' EXIT run_frontend & run_backend - +wait