File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 14
14
fi
15
15
16
16
exit_watcher () {
17
- # Try to find parent process, if not found just kill the process directly
18
- # PARENT_PROCS=$(pgrep -P $!)
19
- # if [ -n "$PARENT_PROCS" ]; then
20
- # kill $PARENT_PROCS &>/dev/null
21
- # fi
22
- # for if it's the node script that runs rewatch also kill the child processes
17
+ # Try to find child process, if not found just kill the process directly
23
18
CHILD_PROCS=$( pgrep -f rewatch)
24
19
if [ -n " $CHILD_PROCS " ]; then
25
- kill $! & > /dev/null
26
20
kill $CHILD_PROCS & > /dev/null
27
- else
28
- # Last resort: just kill the background process
29
- kill $!
30
21
fi
22
+ # for if it's the node script that runs rewatch also kill the child processes
23
+ kill $!
31
24
}
32
25
33
26
rewatch watch & > /dev/null &
You can’t perform that action at this time.
0 commit comments