status-react/scripts/check-metro-shadow-process.sh
Sean Hagstrom 89828ba7fd
chore: allow for overriding metro server port (#20202)
This change will now allow for customizing the port number when running the metro server. The environment variable `RCT_METRO_PORT` can now be set when executing commands like `make run-ios`, `make run ios-device`, and `make run-android`. Though, it should be noted that `make clean` may need to be ran before attempting to set or change `RCT_METRO_PORT` since the react-native app will have statically built code that references the value of RCT_METRO_PORT from compile time and not runtime.
2024-08-05 12:48:35 +01:00

16 lines
493 B
Bash
Executable File

#!/usr/bin/env bash
if pgrep -f 'shadow-cljs watch mobile' > /dev/null; then
echo "Error: make run-clojure is already running in another terminal" >&2
echo "Please close that terminal before running this command." >&2
exit 1
fi
if pgrep -f "react-native start --port=${RCT_METRO_PORT:-8081}" > /dev/null; then
echo "Error: make run-metro is already running in another terminal" >&2
echo "Please close that terminal before running this command." >&2
exit 1
fi
exit 0