From 2e4ecc42d2fb82b5d4ee7a2ef2bbdc30b75aeef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Sat, 24 Mar 2018 12:18:59 +0100 Subject: [PATCH] Handle log stuff in a more robust manner bootstrap script --- hack/bootstrap_tfw_dev.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hack/bootstrap_tfw_dev.sh b/hack/bootstrap_tfw_dev.sh index ab10065..3e49e2d 100755 --- a/hack/bootstrap_tfw_dev.sh +++ b/hack/bootstrap_tfw_dev.sh @@ -6,7 +6,11 @@ BASEIMAGE=baseimage-${TFW_POSTFIX} BACKEND=test-${TFW_POSTFIX} FRONTEND=frontend-${TFW_POSTFIX} LOGFILE=/tmp/bootstrap_tfw.log -trap 'echo && echo "Error! Showing logs at $LOGFILE:" && cat $LOGFILE' ERR + +showlog() { echo && echo "Error! Showing logs:" && cat $LOGFILE; } +cleanlog() { rm $LOGFILE; } +trap showlog ERR +trap cleanlog EXIT : > $LOGFILE echo -n "Cloning TFW repositories... " @@ -27,4 +31,3 @@ wait echo "Done!" echo echo "You can start TFW by executing the ${BACKEND}/hack/tfw_magic_start.sh script." -rm $LOGFILE