mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 18:46:19 +00:00
89828ba7fd
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.
15 lines
258 B
Bash
Executable File
15 lines
258 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
TIMEOUT=10 # Metro should not take this long to start.
|
|
|
|
while [ "${TIMEOUT}" -gt 0 ]; do
|
|
if ! lsof -i:"${RCT_METRO_PORT:-8081}" &> /dev/null; then
|
|
echo "."
|
|
sleep 1
|
|
((TIMEOUT--))
|
|
else
|
|
break
|
|
fi
|
|
done
|