status-react/scripts/run-metro.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

9 lines
288 B
Bash
Executable File

#!/usr/bin/env bash
if pgrep -f "react-native start --port=${RCT_METRO_PORT:-8081}" > /dev/null; then
echo "Info: metro is already running in another terminal"
else
echo "Info: starting a new metro terminal"
react-native start --port=${RCT_METRO_PORT:-8081} --reset-cache
fi