From 6c908011464e412c2fdad9b216d7091f2b293f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 27 Apr 2018 11:28:00 +0200 Subject: [PATCH] Fix cleanup trap failing when not in proper directory --- hack/bootstrap_tfw_dev.sh | 3 ++- hack/oneline_install.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hack/bootstrap_tfw_dev.sh b/hack/bootstrap_tfw_dev.sh index 8e845da..c94c047 100755 --- a/hack/bootstrap_tfw_dev.sh +++ b/hack/bootstrap_tfw_dev.sh @@ -10,6 +10,7 @@ popd() { command popd "$@" > /dev/null; } TFWDEV="${TFWDEV:-0}" TFW_POSTFIX=tutorial-framework +BASEDIR="$(pwd)" BASEIMAGE=baseimage-${TFW_POSTFIX} TEST=test-${TFW_POSTFIX} FRONTEND=frontend-${TFW_POSTFIX} @@ -39,7 +40,7 @@ run() showlog() { echo && echo "Error! Showing logs:" && cat $LOGFILE; } cleanlog() { rm $LOGFILE; } -err_cleanup() { rm -rf "$BASEIMAGE" "$FRONTEND" "$TEST"; } +err_cleanup() { cd "$BASEDIR" && rm -rf "$BASEIMAGE" "$FRONTEND" "$TEST"; } clone_repos() { diff --git a/hack/oneline_install.sh b/hack/oneline_install.sh index 357d461..7ba8dd1 100644 --- a/hack/oneline_install.sh +++ b/hack/oneline_install.sh @@ -1 +1 @@ -URL=https://git.io/vxBfj SHA=40cf2fec4e9d378dd8a4f049fd6ba7b7c415bf699e0a6e329ec8e3cf3f5d383c bash -c 'cmd="$(curl -fsSL $URL)" && [ $(echo "$cmd" | sha256sum | cut -d " " -f1) == $SHA ] && echo "$cmd" | bash || echo Checksum mismatch!' +URL=https://git.io/vxBfj SHA=18a2be757b6367c725aaaa1706c12aacf81684e49c3d911c6fa1f59a9ed996da bash -c 'cmd="$(curl -fsSL $URL)" && [ $(echo "$cmd" | sha256sum | cut -d " " -f1) == $SHA ] && echo "$cmd" | bash || echo Checksum mismatch!'