From 29c65489616e7663e051067efd7511b67ec16f8b Mon Sep 17 00:00:00 2001 From: Sebastian Bargmann Date: Fri, 19 May 2017 14:40:36 -0700 Subject: [PATCH] Run packager.sh using '.' instead of 'source'. Summary: 'source' is not available in all shells on Linux (e.g. dash) and will silently fail launchPackager.command when called from runAndroid.js. react-native run-android will thus silently fail to start the developement server ('JS server'). What existing problem does the pull request solve? When running "react-native run-android" on the below reasonably vanilla Ubuntu system, the development server / packager script fails to start. It fails because sh defaults to dash (not bash) which doesn't know the command 'source'. dot (.) does the same as source, but works in all shells. $ uname -a Linux dallas 4.8.0-52-generic #55~16.04.1-Ubuntu SMP Fri Apr 28 14:36:29 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux $ which sh /bin/sh $ readlink -f /bin/sh /bin/dash react-native-cli: 2.0.1 react-native: 0.44.0 $ ps aux | grep packager (nothing) ps aux | grep packager sh /home/xxx/code/react-native/AwesomeProject/node_modules/react-native/packager/launchPackager.command node /home/xxx/code/react-native/AwesomeProject/node_modules/react-native/packager/../local-cli/cli.js start Closes https://github.com/facebook/react-native/pull/14040 Differential Revision: D5096298 Pulled By: hramos fbshipit-source-id: 88466e802c9bc4358840391edb37e153f0a6b1f7 --- packages/metro-bundler/launchPackager.command | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/metro-bundler/launchPackager.command b/packages/metro-bundler/launchPackager.command index cbeefec4..9e12272a 100755 --- a/packages/metro-bundler/launchPackager.command +++ b/packages/metro-bundler/launchPackager.command @@ -13,7 +13,7 @@ clear THIS_DIR=$(dirname "$0") pushd "$THIS_DIR/.." -source packager/packager.sh +. packager/packager.sh popd echo "Process terminated. Press to close the window"