mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-03 06:10:20 +00:00
support globally installed atom-shell
This commit is contained in:
parent
07d5710a74
commit
ff12e9ada1
9
index.js
9
index.js
@ -9,12 +9,19 @@ 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) {
|
||||
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'))
|
||||
console.error('Using atom-shell version', atomPkg.version, 'from', atomShellPath)
|
||||
|
Loading…
Reference in New Issue
Block a user