From ce24a2f1cfb5dca3ee8eb0e0637e0a34f576c9f5 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 30 Aug 2016 19:25:09 +0200 Subject: [PATCH] Use the correct Atom executable paths on the beta channel Signed-off-by: Nathan Sobo --- atom.sh | 4 +++- src/buffered-node-process.coffee | 11 ++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/atom.sh b/atom.sh index b68716bf4..0a452c7f9 100755 --- a/atom.sh +++ b/atom.sh @@ -55,8 +55,10 @@ fi if [ $OS == 'Mac' ]; then if [ -n "$BETA_VERSION" ]; then ATOM_APP_NAME="Atom Beta.app" + ATOM_EXECUTABLE_NAME="Atom Beta" else ATOM_APP_NAME="Atom.app" + ATOM_EXECUTABLE_NAME="Atom" fi if [ -z "${ATOM_PATH}" ]; then @@ -78,7 +80,7 @@ if [ $OS == 'Mac' ]; then fi if [ $EXPECT_OUTPUT ]; then - "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/Atom" --executed-from="$(pwd)" --pid=$$ "$@" + "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/$ATOM_EXECUTABLE_NAME" --executed-from="$(pwd)" --pid=$$ "$@" exit $? else open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@" diff --git a/src/buffered-node-process.coffee b/src/buffered-node-process.coffee index 406775277..5cab035bc 100644 --- a/src/buffered-node-process.coffee +++ b/src/buffered-node-process.coffee @@ -1,4 +1,5 @@ BufferedProcess = require './buffered-process' +electron = require 'electron' path = require 'path' # Extended: Like {BufferedProcess}, but accepts a Node script as the command @@ -36,14 +37,6 @@ class BufferedNodeProcess extends BufferedProcess # * `exit` The callback {Function} which receives a single argument # containing the exit status (optional). constructor: ({command, args, options, stdout, stderr, exit}) -> - node = - if process.platform is 'darwin' - # Use a helper to prevent an icon from appearing on the Dock - path.resolve(process.resourcesPath, '..', 'Frameworks', - 'Atom Helper.app', 'Contents', 'MacOS', 'Atom Helper') - else - process.execPath - options ?= {} options.env ?= Object.create(process.env) options.env['ELECTRON_RUN_AS_NODE'] = 1 @@ -53,4 +46,4 @@ class BufferedNodeProcess extends BufferedProcess args.unshift(command) args.unshift('--no-deprecation') - super({command: node, args, options, stdout, stderr, exit}) + super({command: process.execPath, args, options, stdout, stderr, exit})