File tree Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 77 },
88 "private" : true ,
99 "scripts" : {
10- "develop" : " gatsby develop" ,
11- "develop:ssr" : " DEV_SSR=true gatsby develop" ,
12- "build" : " gatsby build --verbose --log-pages" ,
10+ "develop" : " ./scripts/ gatsby.sh develop" ,
11+ "develop:ssr" : " DEV_SSR=true ./scripts/ gatsby.sh develop" ,
12+ "build" : " ./scripts/ gatsby.sh build --verbose --log-pages" ,
1313 "clean" : " gatsby clean" ,
1414 "serve" : " gatsby serve" ,
1515 "lint" : " eslint \" **/*.js\" " ,
Original file line number Diff line number Diff line change 1+
2+ #! /bin/bash
3+
4+ ARGS=$@
5+ LOG_FILE=" .gatsby-stderr.log"
6+
7+ trap " rm -f $LOG_FILE " EXIT
8+
9+ function run_with_args {
10+ gatsby $ARGS
11+ }
12+
13+ function clean_and_run {
14+ rm -f $LOG_FILE
15+ gatsby clean
16+ run_with_args
17+ }
18+
19+ run_with_args 2> $LOG_FILE
20+ CODE=$?
21+
22+ if [ $CODE -ne 0 ]; then
23+ echo " Command failed with code $CODE and error logs:"
24+ cat $LOG_FILE
25+
26+ if grep -iqE ' segmentation fault|mutex' $LOG_FILE ; then
27+ echo " Cleaning caches and running again..."
28+ clean_and_run
29+ fi
30+ fi
You can’t perform that action at this time.
0 commit comments