File tree Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ cd ../testrepo
55
66bold " Test: It should compile"
77
8- if rewatch clean ;
8+ if rewatch clean & > /dev/null ;
99then
1010 success " Repo Cleaned"
1111else
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 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
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+ fi
1931}
2032
2133rewatch watch & > /dev/null &
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ if [ "$file_count" -eq 20 ];
3131then
3232 success " Found files with correct suffix"
3333else
34- error " Suffix not correctly used"
34+ error " Suffix not correctly used (file count of $file_count ) "
3535 exit 1
3636fi
3737
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ export REWATCH_EXECUTABLE
1313source ./utils.sh
1414
1515bold " Rescript version"
16- (cd ../testrepo && yarn rescript -v)
16+ (cd ../testrepo && ./node_modules/.bin/ rescript -v)
1717
1818# we need to reset the yarn.lock and package.json to the original state
1919# so there is not diff in git. The CI will install new ReScript package
2020bold " Reset package.json and yarn.lock"
21- git checkout ../testrepo/yarn.lock
22- git checkout ../testrepo/package.json
21+ git checkout ../testrepo/yarn.lock & > /dev/null
22+ git checkout ../testrepo/package.json & > /dev/null
2323success " Reset package.json and yarn.lock"
2424
2525bold " Make sure the testrepo is clean"
You can’t perform that action at this time.
0 commit comments