kill child processes

This commit is contained in:
Ari Lazier 2016-01-22 15:03:00 -08:00
parent 9ac642c7f3
commit 7c8b252969
1 changed files with 9 additions and 11 deletions

View File

@ -34,13 +34,8 @@ function start_packager()
done
}
function kill_packager()
{
rm -f $PACKAGER_OUT
pkill node || true
}
kill_packager
# kill old packagers
pkill node || true
if [ "$TARGET" = "realmjs" ]; then
xcodebuild -scheme RealmJS -configuration "$CONFIGURATION" -sdk iphonesimulator $DESTINATION build test
@ -87,9 +82,9 @@ elif [ "$TARGET" = "react-tests-android" ]; then
LOGCAT_OUT="logcat_out.txt"
rm -f $LOGCAT_OUT
adb logcat -c
adb logcat | tee $LOGCAT_OUT &
LOGCAT_PID=$!
while :;
do
if grep -q "FILE WRITTEN!!" $LOGCAT_OUT
@ -100,12 +95,15 @@ elif [ "$TARGET" = "react-tests-android" ]; then
sleep 2
fi
done
kill $LOGCAT_PID
adb pull /data/data/com.demo/files/tests.xml .
adb pull /data/data/com.demo/files/tests.xml . || true
else
echo "Invalid target '${TARGET}'"
fi
kill_packager
# kill all children
pkill -P $$
pkill node || true
rm -f $PACKAGER_OUT
rm -f $LOGCAT_OUT