From e6dc4b84412eae47991584111bb827707aef0820 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Sat, 12 Mar 2016 16:07:21 +0800 Subject: [PATCH] Override output directory by default --- README.md | 20 ++++++++++---------- src/cli.js | 2 +- src/options/optionsMain.js | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7d987fb..bc02135 100644 --- a/README.md +++ b/README.md @@ -150,13 +150,13 @@ Processor architecture, automatically determined based on the current OS. Can be Electron version without the `v`, see https://github.com/atom/electron/releases. -#### [overwrite] +#### [no-overwrite] ``` --o, --overwrite +--no-overwrite ``` -Specifies if the destination directory should be overwritten. +Specifies if the destination directory should be not overwritten, defaults to false. #### [conceal] @@ -296,22 +296,22 @@ In your `.js` file: ```javascript var nativefier = require('nativefier').default; -// possible options +// possible options, defaults unless specified otherwise var options = { - name: 'Web WhatsApp', + name: 'Web WhatsApp', // will be inferred if not specified targetUrl: 'http://web.whatsapp.com', // required - platform: 'darwin', - arch: 'x64', + platform: 'darwin', // defaults to the current system + arch: 'x64', // defaults to the current system version: '0.36.4', - out: '~/Desktop', - overwrite: true, + out: '.', + overwrite: false, asar: false, // see conceal icon: '~/Desktop/icon.png', counter: false, width: 1280, height: 800, showMenuBar: false, - userAgent: null, + userAgent: 'Mozilla ...', // will infer a default for your current system ignoreCertificate: false, insecure: false, honest: false diff --git a/src/cli.js b/src/cli.js index f068740..715b0a9 100755 --- a/src/cli.js +++ b/src/cli.js @@ -25,7 +25,7 @@ if (require.main === module) { .option('-p, --platform ', '\'linux\', \'win32\', or \'darwin\'') .option('-a, --arch ', '\'ia32\' or \'x64\'') .option('-e, --electron-version ', 'electron version to package, without the \'v\', see https://github.com/atom/electron/releases') - .option('-o, --overwrite', 'if output directory for a platform already exists, replaces it rather than skipping it, defaults to false') + .option('--no-overwrite', 'do not override output directory if it already exists, defaults to false') .option('-c, --conceal', 'packages the source code within your app into an archive, defaults to false, see http://electron.atom.io/docs/v0.36.0/tutorial/application-packaging/') .option('--counter', 'if the target app should use a persistant counter badge in the dock (OSX only), defaults to false') .option('-i, --icon ', 'the icon file to use as the icon for the app (should be a .icns file on OSX, .png for Windows and Linux)') diff --git a/src/options/optionsMain.js b/src/options/optionsMain.js index 1d80ed3..73353f9 100644 --- a/src/options/optionsMain.js +++ b/src/options/optionsMain.js @@ -38,7 +38,7 @@ function optionsFactory(inpOptions, callback) { version: inpOptions.electronVersion || ELECTRON_VERSION, nativefierVersion: packageJson.version, out: inpOptions.out || process.cwd(), - overwrite: inpOptions.overwrite || false, + overwrite: inpOptions.overwrite, asar: inpOptions.conceal || false, icon: inpOptions.icon, counter: inpOptions.counter || false,