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