@@ -46,12 +46,17 @@ if [ -d "src" ]; then
4646 cd src
4747fi
4848
49- if [ " $( pgrep -f ' python main.py' ) " ]; then
49+ if [ ! " $( which pgrep) " ]; then
50+ echo " Need pgrep installed. Try 'brew install proctools'"
51+ exit 1
52+ fi
53+
54+ if [ " $( pgrep -if ' python main.py' ) " ]; then
5055 echo " Killing existing server to run a fresh version"
5156 pkill -9 -f " python main.py"
5257fi
5358
54- if [ " $( pgrep -f ' node ./tools/generate/chapter_watcher' ) " ]; then
59+ if [ " $( pgrep -if ' node ./tools/generate/chapter_watcher' ) " ]; then
5560 echo " Killing existing watcher to run a fresh version"
5661 pkill -9 -f " node ./tools/generate/chapter_watcher"
5762fi
@@ -65,7 +70,7 @@ python main.py background &
6570# Sleep for a couple of seconds to make sure server is up
6671sleep 2
6772# Check website is running as won't have got feedback as backgrounded
68- pgrep -f " python main.py"
73+ pgrep -if " python main.py"
6974
7075echo " Installing node modules"
7176npm install
@@ -98,7 +103,7 @@ if [ "${debug}" == "1" ]; then
98103 echo " Monitoring templates for changes"
99104 npm run watch &
100105
101- if [ " $( pgrep -f ' python main.py' ) " ]; then
106+ if [ " $( pgrep -if ' python main.py' ) " ]; then
102107 echo " Killing server to run a fresh version in debug mode"
103108 pkill -9 -f " python main.py"
104109 fi
0 commit comments