mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 11:05:21 +00:00
UIExplorer e2e: fix duplicated exit trap
Summary: I accidentally introduced an exit trap, allthough a cleanup handler already existed. This moves killing of background processes into the existing trap. Reviewed By: bestander Differential Revision: D4681289 fbshipit-source-id: f8bcdcac7b246854e3ee024c9335b6c4eb3aacbd
This commit is contained in:
parent
8d6776c143
commit
21c229119d
@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
trap 'kill $(jobs -p)' INT TERM EXIT
|
||||
|
||||
SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
ROOT=$(dirname "$SCRIPTS")
|
||||
|
||||
@ -18,12 +16,15 @@ function cleanup {
|
||||
WATCHMAN_LOGS=/usr/local/Cellar/watchman/3.1/var/run/watchman/$USER.log
|
||||
[ -f "$WATCHMAN_LOGS" ] && cat "$WATCHMAN_LOGS"
|
||||
fi
|
||||
# kill backgrounded jobs
|
||||
# shellcheck disable=SC2046
|
||||
kill $(jobs -p)
|
||||
# kill whatever is occupying port 8081 (packager)
|
||||
lsof -i tcp:8081 | awk 'NR!=1 {print $2}' | xargs kill
|
||||
# kill whatever is occupying port 5555 (web socket server)
|
||||
lsof -i tcp:5555 | awk 'NR!=1 {print $2}' | xargs kill
|
||||
}
|
||||
trap cleanup EXIT
|
||||
trap cleanup INT TERM EXIT
|
||||
|
||||
# Start the packager
|
||||
(exec "./packager/launchPackager.command" || echo "Can't start packager automatically") &
|
||||
|
Loading…
x
Reference in New Issue
Block a user