Use `windows` and `osx` to specify platform

This commit is contained in:
Jia Hao 2016-03-12 16:47:18 +08:00
parent cbff6ba50d
commit 5bad1d08dd
3 changed files with 12 additions and 2 deletions

View File

@ -134,7 +134,9 @@ The name of the application, which will affect strings in titles and the icon.
```
-p, --platform <value>
```
Automatically determined based on the current OS. Can be overwritten by specifying either `linux`, `win32`, or `darwin`.
Automatically determined based on the current OS. Can be overwritten by specifying either `linux`, `windows`, or `osx`.
The alternative values `win32` (for Windows) or `darwin`, `mac` (for OSX) can also be used.
#### [arch]

View File

@ -22,7 +22,7 @@ if (require.main === module) {
program.out = appDir;
})
.option('-n, --name <value>', 'app name')
.option('-p, --platform <value>', '\'linux\', \'win32\', or \'darwin\'')
.option('-p, --platform <value>', '\'osx\', \'linux\' or \'windows\'')
.option('-a, --arch <value>', '\'ia32\' or \'x64\'')
.option('-e, --electron-version <value>', 'electron version to package, without the \'v\', see https://github.com/atom/electron/releases')
.option('--no-overwrite', 'do not override output directory if it already exists, defaults to false')

View File

@ -57,6 +57,14 @@ function optionsFactory(inpOptions, callback) {
options.userAgent = null;
}
if (options.platform.toLowerCase() === 'windows') {
options.platform = 'win32';
}
if (options.platform.toLowerCase() === 'osx' || options.platform.toLowerCase() === 'mac') {
options.platform = 'darwin';
}
async.waterfall([
callback => {
if (options.icon) {