File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 1414fi
1515
1616exit_watcher () {
17- # we need to kill the parent process (rewatch)
18- kill $( pgrep -P $! ) ;
17+ # Try to find child process, if not found just kill the process directly
18+ rm lib/rewatch.lock
1919}
2020
21- rewatch watch & > /dev/null &
22- success " Watcher Started"
21+ rewatch_bg watch > /dev/null 2>&1 &
22+ echo " Started watcher in background "
2323
2424sleep 1
2525
26- if rewatch watch 2>&1 | grep ' Could not start Rewatch:' & > /dev/null;
26+ if rewatch watch | grep ' Could not start Rewatch:' & > /dev/null;
2727then
28+ # rm output.txt
2829 success " Lock is correctly set"
2930 exit_watcher
3031else
32+ # rm output.txt
3133 error " Not setting lock correctly"
3234 exit_watcher
3335 exit 1
3638sleep 1
3739
3840touch tmp.txt
39- rewatch watch & > tmp.txt &
41+ rewatch_bg watch > tmp.txt 2>&1 &
4042success " Watcher Started"
4143
4244sleep 1
5153 exit_watcher
5254fi
5355
54- rm tmp.txt
56+ rm tmp.txt
You can’t perform that action at this time.
0 commit comments