2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-06-06 14:30:49 +00:00

Ensure the out dir specified exists when building OSX app

This commit is contained in:
Mark Lee 2015-05-10 15:44:38 -07:00
parent ab5da23a70
commit 1e1a479b23

22
mac.js
View File

@ -98,18 +98,22 @@ function buildMacApp (opts, cb, newApp) {
function moveApp () {
// finally, move app into cwd
var finalPath = path.join(opts.out || process.cwd(), opts.name + '.app')
var outdir = opts.out || process.cwd()
var finalPath = path.join(outdir, opts.name + '.app')
fs.rename(newApp, finalPath, function moved (err) {
mkdirp(outdir, function mkoutdirp () {
if (err) return cb(err)
if (opts.asar) {
asarApp(function (err) {
if (err) return cb(err)
fs.rename(newApp, finalPath, function moved (err) {
if (err) return cb(err)
if (opts.asar) {
asarApp(function (err) {
if (err) return cb(err)
updateMacIcon()
})
} else {
updateMacIcon()
})
} else {
updateMacIcon()
}
}
})
})
}