We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d497bec commit 456a012Copy full SHA for 456a012
rewatch/tests/lock.sh
@@ -14,20 +14,13 @@ else
14
fi
15
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
+ # Try to find child process, if not found just kill the process directly
23
CHILD_PROCS=$(pgrep -f rewatch)
24
if [ -n "$CHILD_PROCS" ]; then
25
- kill $! &>/dev/null
26
kill $CHILD_PROCS &>/dev/null
27
- else
28
- # Last resort: just kill the background process
29
- kill $!
30
+ # for if it's the node script that runs rewatch also kill the child processes
+ kill $!
31
}
32
33
rewatch watch &>/dev/null &
0 commit comments