mirror of
				https://github.com/avatao-content/test-tutorial-framework
				synced 2025-11-04 05:42:54 +00:00 
			
		
		
		
	Make bootstrap script clean up after itself in case of errors
This commit is contained in:
		@@ -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!"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user