keep existing metro session alive (#19458)

The killing of metro terminal upset a few people and this PR fixes that.

## Summary
Modify build step to check if metro is running already.
If so then we do not attempt to start metro again.
If not then we start metro after building android / iOS.

## Review notes
* case 1
    - `make run-clojure`
    - `make run-metro`
    - `make run-android` or `make run-ios` should work the way it did before.
* case 2
    - `make run-clojure`
    - `make run-android` or `make run-ios` should also work.

## Platforms
- Android
- iOS
This commit is contained in:
Siddarth Kumar 2024-04-01 16:47:48 +05:30 committed by GitHub
parent 2dfb3ab838
commit 48789e8793
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
pkill -f 'react-native start' if pgrep -f 'react-native start' > /dev/null; then
echo "Info: metro is already running in another terminal"
react-native start --reset-cache else
echo "Info: starting a new metro terminal"
react-native start --reset-cache
fi