Skip to content

Commit

Permalink
Fixed always detect osx32 when in run mode. And add -n options to set…
Browse files Browse the repository at this point in the history
… appName
  • Loading branch information
bramblex committed Aug 30, 2017
1 parent ab700a5 commit dc9180e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/nwbuild
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var argv = optimist
.usage('Usage: nwbuild [options] [path]')

.alias('p', 'platforms')
.default('p', 'osx32,osx64,win32,win64')
.describe('p', 'Platforms to build, comma-sperated, can be: win32,win64,osx32,osx64,linux32,linux64')

.alias('v', 'version')
Expand All @@ -21,17 +20,18 @@ var argv = optimist
.describe('r', 'Runs NW.js for the current platform')
.boolean('r')


.alias('o', 'buildDir')
.default('o', './build')
.describe('o', 'The build folder')


.alias('f', 'forceDownload')
.default('f', false)
.describe('f', 'Force download of NW.js')
.boolean('f')

.alias('n', 'name')
.describe('n', 'The Name of your NW.js app.')

.describe('cacheDir', 'The cache folder')

.default('quiet', false)
Expand All @@ -54,9 +54,10 @@ if(!files) {
}

var options = {
appName: argv.name,
files: path.resolve(process.cwd(), files) + '/**/*',
flavor: argv.flavor || 'sdk',
platforms: argv.platforms.split(','),
platforms: argv.platforms ? argv.platforms.split(',') : null,
version: argv.version,
macIcns: argv.macIcns || false,
winIco: argv.winIco || false,
Expand All @@ -74,6 +75,11 @@ if(argv.r) {
options.currentPlatform = currentPlatform;
}

// Set default target platforms here
// Remove osx32 from default, nwjs didn't support osx32 yet
if (!options.platforms) {
options.platforms = ['osx64', 'win32', 'win63']
}

// Build App
var nw = new NwBuilder(options);
Expand Down

0 comments on commit dc9180e

Please sign in to comment.