mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-23 15:18:30 +00:00
Fix #65: Rename Helper application on Mac OS X
This fixes the helper process showing up in Activity Monitor as "Electron Helper"; it will now show up as "<appname> Helper".
This commit is contained in:
parent
554f3b7354
commit
dd2a5d4b68
20
mac.js
20
mac.js
@ -35,7 +35,8 @@ function buildMacApp (opts, cb, newApp) {
|
|||||||
var paths = {
|
var paths = {
|
||||||
info1: path.join(newApp, 'Contents', 'Info.plist'),
|
info1: path.join(newApp, 'Contents', 'Info.plist'),
|
||||||
info2: path.join(newApp, 'Contents', 'Frameworks', 'Electron Helper.app', 'Contents', 'Info.plist'),
|
info2: path.join(newApp, 'Contents', 'Frameworks', 'Electron Helper.app', 'Contents', 'Info.plist'),
|
||||||
app: path.join(newApp, 'Contents', 'Resources', 'app')
|
app: path.join(newApp, 'Contents', 'Resources', 'app'),
|
||||||
|
helper: path.join(newApp, 'Contents', 'Frameworks', 'Electron Helper.app')
|
||||||
}
|
}
|
||||||
|
|
||||||
// update plist files
|
// update plist files
|
||||||
@ -72,6 +73,21 @@ function buildMacApp (opts, cb, newApp) {
|
|||||||
ncp(opts.dir, paths.app, {filter: common.userIgnoreFilter(opts), dereference: true}, function copied (err) {
|
ncp(opts.dir, paths.app, {filter: common.userIgnoreFilter(opts), dereference: true}, function copied (err) {
|
||||||
if (err) return cb(err)
|
if (err) return cb(err)
|
||||||
|
|
||||||
|
function moveHelper () {
|
||||||
|
// Move helper binary before moving the parent helper app directory itself
|
||||||
|
var helperDestination = path.join(path.dirname(paths.helper), opts.name + ' Helper.app')
|
||||||
|
var helperBinary = path.join(paths.helper, 'Contents', 'MacOS', 'Electron Helper')
|
||||||
|
var helperBinaryDestination = path.join(path.dirname(helperBinary), opts.name + ' Helper')
|
||||||
|
|
||||||
|
fs.rename(helperBinary, helperBinaryDestination, function (err) {
|
||||||
|
if (err) return cb(err)
|
||||||
|
fs.rename(paths.helper, helperDestination, function (err) {
|
||||||
|
if (err) return cb(err)
|
||||||
|
moveApp()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function moveApp () {
|
function moveApp () {
|
||||||
// finally, move app into cwd
|
// finally, move app into cwd
|
||||||
var outdir = opts.out || process.cwd()
|
var outdir = opts.out || process.cwd()
|
||||||
@ -122,6 +138,6 @@ function buildMacApp (opts, cb, newApp) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
common.prune(opts, paths.app, cb, moveApp)
|
common.prune(opts, paths.app, cb, moveHelper)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user