Skip to content

Commit

Permalink
keep existing metro session alive (#19458)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
siddarthkay authored Apr 1, 2024
1 parent 2dfb3ab commit 48789e8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/run-metro.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

pkill -f 'react-native start'

react-native start --reset-cache
if pgrep -f 'react-native start' > /dev/null; then
echo "Info: metro is already running in another terminal"
else
echo "Info: starting a new metro terminal"
react-native start --reset-cache
fi

0 comments on commit 48789e8

Please sign in to comment.