This repository was archived by the owner on Jan 26, 2019. It is now read-only.
File tree 2 files changed +26
-7
lines changed
2 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 13
13
"scripts" : {
14
14
"start" : " node scripts/start.js --debug-template" ,
15
15
"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"
17
18
},
18
19
"files" : [
19
20
" LICENSE" ,
Original file line number Diff line number Diff line change 8
8
# Start in tests/ even if run from root directory
9
9
cd " $( dirname " $0 " ) "
10
10
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
15
34
16
35
# Echo every command being executed
17
36
set -x
@@ -81,5 +100,4 @@ test -e build/*.js
81
100
npm start -- --smoke-test
82
101
83
102
# 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