Skip to content

Commit

Permalink
Fixed script for Packager.sh in RNTester (#36582)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #36582

This change should fix the path to run packager.sh directly from Xcode, this was broken after the Monorepo work.

## Changelog:
[internal] - update path to run packager.sh

Reviewed By: huntie, hoxyq

Differential Revision: D44292167

fbshipit-source-id: b3b267708e400999c3a22da3da63dfaa92f44a0b
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Mar 23, 2023
1 parent 308838c commit d1586af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions packages/react-native/scripts/packager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ PROJECT_ROOT=${PROJECT_ROOT:-"$THIS_DIR/../../.."}
# shellcheck disable=SC1090
source "${THIS_DIR}/node-binary.sh"

# When running react-native tests, react-native doesn't live in node_modules but in the PROJECT_ROOT
if [ ! -d "$THIS_DIR/../../../node_modules/react-native" ];
then
PROJECT_ROOT="$THIS_DIR/../../.."
fi
# Start packager from PROJECT_ROOT
cd "$PROJECT_ROOT" || exit
"$NODE_BINARY" "$REACT_NATIVE_ROOT/cli.js" start --custom-log-reporter-path "$THIS_DIR/packager-reporter.js" "$@"
2 changes: 1 addition & 1 deletion packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -x\n\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open -n \"$SRCROOT/../react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
shellScript = "set -x\n\n# RN-Tester does not have an iOS directory. The PROJECT_ROOT should \n# point to the folder where the `metro.config.js` file lives.\nexport PROJECT_ROOT=$(pwd)\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open -n \"$SRCROOT/../react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
showEnvVarsInLog = 0;
};
68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */ = {
Expand Down

0 comments on commit d1586af

Please sign in to comment.