This commit is contained in:
Max Ogden 2015-04-27 12:12:17 -07:00
commit 290e5c1e35
2 changed files with 15 additions and 2 deletions

View File

@ -109,9 +109,22 @@ module.exports = function packager (opts, cb) {
var finalPath = path.join(opts.out || process.cwd(), opts.name + '.app')
fs.rename(newApp, finalPath, function moved (err) {
cb(err, finalPath)
if (err) return cb(err)
updateMacIcon()
})
}
})
}
function updateMacIcon () {
var finalPath = path.join(opts.out || process.cwd(), opts.name + '.app')
if (!opts.icon) {
return cb(null, finalPath)
}
ncp(opts.icon, path.join(finalPath, 'Contents', 'Resources', 'atom.icns'), function copied (err) {
cb(err, finalPath)
})
}
}

View File

@ -43,7 +43,7 @@ You should be able to double-click `AppName.app` to launch the app. If not, chec
these are optional CLI options you can pass in
- `out` (default current working dir) - the dir to put the app into at the end
- `version` (default hardcoded in source) - electron version to use
- `icon` - the icon file to use as the icon for the app
- `app-bundle-id` - bundle identifier to use in the app plist
- `helper-bundle-id` - bundle identifier to use in the app helper plist
- `ignore` (default none) - do not copy files into App whose filenames regex .match this string