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
5
5
6
6
bold " Test: It should compile"
7
7
8
- if rewatch clean ;
8
+ if rewatch clean & > /dev/null ;
9
9
then
10
10
success " Repo Cleaned"
11
11
else
Original file line number Diff line number Diff line change 14
14
fi
15
15
16
16
exit_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
19
31
}
20
32
21
33
rewatch watch & > /dev/null &
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ if [ "$file_count" -eq 20 ];
31
31
then
32
32
success " Found files with correct suffix"
33
33
else
34
- error " Suffix not correctly used"
34
+ error " Suffix not correctly used (file count of $file_count ) "
35
35
exit 1
36
36
fi
37
37
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ export REWATCH_EXECUTABLE
13
13
source ./utils.sh
14
14
15
15
bold " Rescript version"
16
- (cd ../testrepo && yarn rescript -v)
16
+ (cd ../testrepo && ./node_modules/.bin/ rescript -v)
17
17
18
18
# we need to reset the yarn.lock and package.json to the original state
19
19
# so there is not diff in git. The CI will install new ReScript package
20
20
bold " 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
23
23
success " Reset package.json and yarn.lock"
24
24
25
25
bold " Make sure the testrepo is clean"
You can’t perform that action at this time.
0 commit comments