Skip to content

Commit a45d346

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Fixed script for Packager.sh in RNTester (facebook#36582)
Summary: Pull Request resolved: facebook#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: 90e0291aa7a15189c72cae99c5d38c84c7243a80
1 parent 7259cb3 commit a45d346

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

packages/react-native/scripts/packager.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ PROJECT_ROOT=${PROJECT_ROOT:-"$THIS_DIR/../../.."}
1414
# shellcheck disable=SC1090
1515
source "${THIS_DIR}/node-binary.sh"
1616

17-
# When running react-native tests, react-native doesn't live in node_modules but in the PROJECT_ROOT
18-
if [ ! -d "$THIS_DIR/../../../node_modules/react-native" ];
19-
then
20-
PROJECT_ROOT="$THIS_DIR/../../.."
21-
fi
2217
# Start packager from PROJECT_ROOT
2318
cd "$PROJECT_ROOT" || exit
2419
"$NODE_BINARY" "$REACT_NATIVE_ROOT/cli.js" start --custom-log-reporter-path "$THIS_DIR/packager-reporter.js" "$@"

packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@
644644
);
645645
runOnlyForDeploymentPostprocessing = 0;
646646
shellPath = /bin/sh;
647-
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";
647+
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";
648648
showEnvVarsInLog = 0;
649649
};
650650
68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */ = {

0 commit comments

Comments
 (0)