-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5096 from dklymenk/4819-improve-check-port-script
#4819 improve the check port script
- Loading branch information
Showing
3 changed files
with
23 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const {isPackagerRunning} = require('@react-native-community/cli-tools'); | ||
|
||
/** | ||
* Function isPackagerRunning indicates whether or not the packager is running. It returns a promise that | ||
* returns one of these possible values: | ||
* - `running`: the packager is running | ||
* - `not_running`: the packager nor any process is running on the expected port. | ||
* - `unrecognized`: one other process is running on the port we expect the packager to be running. | ||
*/ | ||
isPackagerRunning().then((result) => { | ||
if (result === 'unrecognized') { | ||
console.error( | ||
'The port 8081 is currently in use.', | ||
'You can run `lsof -i :8081` to see which program is using it.\n', | ||
); | ||
process.exit(1); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters