Skip to content

Commit

Permalink
Fix launchPackager step from Xcode (#227)
Browse files Browse the repository at this point in the history
When packager is being launched by Xcode during run phase (by `launchPackager.command`), current working directory is set to `/`. This results in an awkward error saying "Cannot find /node_modules/.bin/haul" (note it looks in wrong folder - in this case, top level one).

In order for this to function properly, we need to use $THIS_DIR variable that is set by `launchPackager.command` before executing `packager.sh` script.
  • Loading branch information
grabbou authored and satya164 committed Sep 3, 2017
1 parent 7c89fc9 commit 5f756b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/haul-integrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ SRC="$(cd "${SCRIPT_SRC}" && pwd)"
sed -i -e 's|$REACT_NATIVE_DIR/local-cli/cli.js|./node_modules/.bin/haul|' ${SRC}/react-native-xcode.sh

# Replace `react-native start` in `packager.sh`
PACKAGER_CONTENT="cd ../../../ && node \"./node_modules/.bin/haul\" start --platform ios \"\$@\""
PACKAGER_CONTENT="cd \"$THIS_DIR/../../../\" && node \"./node_modules/.bin/haul\" start --platform ios \"\$@\""
echo "$PACKAGER_CONTENT" > ${SRC}/packager.sh

0 comments on commit 5f756b5

Please sign in to comment.