From ff12e9ada18f57c90b858486423165e76889cf6e Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Sun, 5 Apr 2015 09:04:24 -0700 Subject: [PATCH] support globally installed atom-shell --- index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2f4f11a..9106c69 100644 --- a/index.js +++ b/index.js @@ -9,11 +9,18 @@ var rimraf = require('rimraf') var ncp = require('ncp').ncp module.exports = function packager (opts, cb) { + var atomShellPath + try { - var atomShellPath = require.resolve('atom-shell') + atomShellPath = require.resolve('atom-shell') atomShellPath = path.join(atomShellPath, '..') } catch (e) { - cb(new Error('Cannot find atom-shell from here, please install it from npm')) + try { + atomShellPath = require.resolve(path.join(process.execPath, '../../lib/node_modules/atom-shell')) + atomShellPath = path.join(atomShellPath, '..') + } catch (e) { + cb(new Error('Cannot find atom-shell from here, please install it from npm')) + } } var atomPkg = require(path.join(atomShellPath, 'package.json'))