mirror of
https://github.com/jiahaog/Nativefier
synced 2024-06-29 08:00:47 +02:00
add --icon support
This commit is contained in:
parent
a6cf85d0f6
commit
be1c139b5a
17
index.js
17
index.js
|
@ -109,9 +109,22 @@ module.exports = function packager (opts, cb) {
|
||||||
var finalPath = path.join(opts.out || process.cwd(), opts.name + '.app')
|
var finalPath = path.join(opts.out || process.cwd(), opts.name + '.app')
|
||||||
|
|
||||||
fs.rename(newApp, finalPath, function moved (err) {
|
fs.rename(newApp, finalPath, function moved (err) {
|
||||||
|
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)
|
cb(err, finalPath)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ these are optional CLI options you can pass in
|
||||||
|
|
||||||
- `out` (default current working dir) - the dir to put the app into at the end
|
- `out` (default current working dir) - the dir to put the app into at the end
|
||||||
- `version` (default hardcoded in source) - atom-shell version to use
|
- `version` (default hardcoded in source) - atom-shell 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
|
- `app-bundle-id` - bundle identifier to use in the app plist
|
||||||
- `helper-bundle-id` - bundle identifier to use in the app helper 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
|
- `ignore` (default none) - do not copy files into App whose filenames regex .match this string
|
||||||
|
|
Loading…
Reference in New Issue
Block a user