mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-14 15:47:17 +00:00
Make bootstrap script clean up after itself in case of errors
This commit is contained in:
parent
01eaf08f73
commit
cf1174250b
@ -12,7 +12,8 @@ LOGFILE=/tmp/bootstrap_tfw.log
|
|||||||
|
|
||||||
showlog() { echo && echo "Error! Showing logs:" && cat $LOGFILE; }
|
showlog() { echo && echo "Error! Showing logs:" && cat $LOGFILE; }
|
||||||
cleanlog() { rm $LOGFILE; }
|
cleanlog() { rm $LOGFILE; }
|
||||||
trap showlog ERR
|
err_cleanup() { rm -rf "$BASEIMAGE" "$FRONTEND" "$TEST"; }
|
||||||
|
trap 'err_cleanup; showlog' ERR
|
||||||
trap cleanlog EXIT
|
trap cleanlog EXIT
|
||||||
|
|
||||||
: > $LOGFILE
|
: > $LOGFILE
|
||||||
@ -23,7 +24,7 @@ echo -n "test... " && git clone git@github.com:avatao-content/${TEST}.git >> $LO
|
|||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
|
||||||
echo -n "Installing frontend dependencies... "
|
echo -n "Installing frontend dependencies... "
|
||||||
cd ${FRONTEND}
|
cd "$FRONTEND"
|
||||||
yarn install >> $LOGFILE 2>&1
|
yarn install >> $LOGFILE 2>&1
|
||||||
cd ..
|
cd ..
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
Loading…
Reference in New Issue
Block a user