File tree Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 1313 "scripts" : {
1414 "start" : " node scripts/start.js --debug-template" ,
1515 "build" : " node scripts/build.js --debug-template" ,
16- "create-react-app" : " node global-cli/index.js --scripts-version \" $PWD/`npm pack`\" "
16+ "create-react-app" : " node global-cli/index.js --scripts-version \" $PWD/`npm pack`\" " ,
17+ "test" : " tasks/e2e.sh"
1718 },
1819 "files" : [
1920 " LICENSE" ,
Original file line number Diff line number Diff line change 88# Start in tests/ even if run from root directory
99cd " $( dirname " $0 " ) "
1010
11- # Exit the script on any command with non 0 return code
12- # We assume that all the commands in the pipeline set their return code
13- # properly and that we do not need to validate that the output is correct
14- set -e
11+ function cleanup {
12+ echo ' Cleaning up.'
13+ cd $initial_path
14+ rm -rf $temp_cli_path $temp_app_path
15+ }
16+
17+ function handle_error {
18+ echo " $( basename $0 ) : \033[31mERROR!\033[m An error was encountered executing \033[36mline $1 \033[m."
19+ handle_exit
20+ exit 1
21+ }
22+
23+ function handle_exit {
24+ cleanup
25+ echo ' Exiting.'
26+ exit
27+ }
28+
29+ # Exit the script with a helpful error message when any error is encountered
30+ trap ' set +x; handle_error $LINENO $BASH_COMMAND' ERR
31+
32+ # Cleanup before exit on any termination signal
33+ trap ' set +x; handle_exit' SIGQUIT SIGTERM SIGINT SIGKILL SIGHUP
1534
1635# Echo every command being executed
1736set -x
@@ -81,5 +100,4 @@ test -e build/*.js
81100npm start -- --smoke-test
82101
83102# Cleanup
84- cd $initial_path
85- rm -rf $temp_cli_path $temp_app_path
103+ cleanup
You can’t perform that action at this time.
0 commit comments