mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-12-05 02:31:33 +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; }
|
||||
cleanlog() { rm $LOGFILE; }
|
||||
trap showlog ERR
|
||||
err_cleanup() { rm -rf "$BASEIMAGE" "$FRONTEND" "$TEST"; }
|
||||
trap 'err_cleanup; showlog' ERR
|
||||
trap cleanlog EXIT
|
||||
|
||||
: > $LOGFILE
|
||||
@ -23,7 +24,7 @@ echo -n "test... " && git clone git@github.com:avatao-content/${TEST}.git >> $LO
|
||||
echo "Done!"
|
||||
|
||||
echo -n "Installing frontend dependencies... "
|
||||
cd ${FRONTEND}
|
||||
cd "$FRONTEND"
|
||||
yarn install >> $LOGFILE 2>&1
|
||||
cd ..
|
||||
echo "Done!"
|
||||
|
Loading…
Reference in New Issue
Block a user