From 6a58f6054a5ece8392070885406af3feeec05cca Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 5 Nov 2014 12:11:42 +0800 Subject: [PATCH] Pass $PATH by command line --- atom.sh | 2 +- src/browser/main.coffee | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/atom.sh b/atom.sh index c7b7bd45d..4a64ee40a 100755 --- a/atom.sh +++ b/atom.sh @@ -63,7 +63,7 @@ if [ $OS == 'Mac' ]; then "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/Atom" --executed-from="$(pwd)" --pid=$$ "$@" exit $? else - open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ "$@" + open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@" fi elif [ $OS == 'Linux' ]; then SCRIPT=$(readlink -f "$0") diff --git a/src/browser/main.coffee b/src/browser/main.coffee index 64c3227e3..624c5166c 100644 --- a/src/browser/main.coffee +++ b/src/browser/main.coffee @@ -134,6 +134,10 @@ parseCommandLine = -> unless fs.statSyncNoException(resourcePath) resourcePath = path.dirname(path.dirname(__dirname)) + # On Yosemite the $PATH is not inherited by the "open" command, so we have to + # explicitly pass it by command line, see http://git.io/YC8_Ew. + process.env.PATH = args['path-environment'] if args['path-environment'] + {resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed, devMode, safeMode, newWindow, specDirectory, logFile} start()