2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-06-15 10:22:21 +00:00

support globally installed atom-shell

This commit is contained in:
Mathias Buus 2015-04-05 09:04:24 -07:00
parent 07d5710a74
commit ff12e9ada1

View File

@ -9,11 +9,18 @@ var rimraf = require('rimraf')
var ncp = require('ncp').ncp var ncp = require('ncp').ncp
module.exports = function packager (opts, cb) { module.exports = function packager (opts, cb) {
var atomShellPath
try { try {
var atomShellPath = require.resolve('atom-shell') atomShellPath = require.resolve('atom-shell')
atomShellPath = path.join(atomShellPath, '..') atomShellPath = path.join(atomShellPath, '..')
} catch (e) { } 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')) var atomPkg = require(path.join(atomShellPath, 'package.json'))