mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-29 20:59:03 +00:00
Added codesign
This commit is contained in:
parent
1127084ce7
commit
d4f4c78769
26
mac.js
26
mac.js
@ -108,24 +108,30 @@ function buildMacApp (opts, cb, newApp) {
|
|||||||
if (opts.asar) {
|
if (opts.asar) {
|
||||||
asarApp(function (err) {
|
asarApp(function (err) {
|
||||||
if (err) return cb(err)
|
if (err) return cb(err)
|
||||||
updateMacIcon()
|
updateMacIcon(function (err) {
|
||||||
|
if (err) return cb(err)
|
||||||
|
codesign()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
updateMacIcon()
|
updateMacIcon(function (err) {
|
||||||
|
if (err) return cb(err)
|
||||||
|
codesign()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateMacIcon () {
|
function updateMacIcon (cb) {
|
||||||
var finalPath = path.join(opts.out || process.cwd(), opts.name + '.app')
|
var finalPath = path.join(opts.out || process.cwd(), opts.name + '.app')
|
||||||
|
|
||||||
if (!opts.icon) {
|
if (!opts.icon) {
|
||||||
return cb(null, finalPath)
|
return cb(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
ncp(opts.icon, path.join(finalPath, 'Contents', 'Resources', 'atom.icns'), function copied (err) {
|
ncp(opts.icon, path.join(finalPath, 'Contents', 'Resources', 'atom.icns'), function copied (err) {
|
||||||
cb(err, finalPath)
|
cb(err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,5 +144,15 @@ function buildMacApp (opts, cb, newApp) {
|
|||||||
rimraf(src, cb)
|
rimraf(src, cb)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function codesign () {
|
||||||
|
var appPath = path.join(opts.out || process.cwd(), opts.name + '.app')
|
||||||
|
|
||||||
|
if (!opts.sign) return cb(null, appPath)
|
||||||
|
|
||||||
|
child.exec('codesign --deep --force --sign ' + opts.sign + ' ' + appPath, function (err, stdout, stderr) {
|
||||||
|
cb(err, appPath)
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user