diff --git a/src/cli.js b/src/cli.js index 90e7489..5d766a9 100755 --- a/src/cli.js +++ b/src/cli.js @@ -44,21 +44,21 @@ function main(program) { if (require.main === module) { program .version(packageJson.version) - .arguments(' [appDir]') + .arguments(' [dest]') .action(function (targetUrl, appDir) { program.targetUrl = targetUrl; program.outDir = appDir; }) - .option('-n, --appName [value]', 'app name') - .option('-p, --platform [platform]', '\'linux\', \'win32\', or \'darwin\'') - .option('-a, --arch [architecture]', '\'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 true') + .option('-n, --app-name ', 'app name') + .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('-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('-i, --icon [dir]', 'the icon file to use as the icon for the app (should be a .icns file on OSX)') .option('-b, --badge', 'if the target app should show badges in the dock on receipt of desktop notifications (OSX only), defaults to false') - .option('-w, --width [value]', 'set window width, defaults to 1280px') - .option('-h, --height [value]', 'set window height, defaults to 800px') + .option('-i, --icon ', 'the icon file to use as the icon for the app (should be a .icns file on OSX)') + .option('-w, --width ', 'set window width, defaults to 1280px', parseInt) + .option('-h, --height ', 'set window height, defaults to 800px', parseInt) .parse(process.argv); if (!process.argv.slice(2).length) { diff --git a/src/options.js b/src/options.js index a843ea2..a36db8c 100644 --- a/src/options.js +++ b/src/options.js @@ -15,7 +15,7 @@ function optionsFactory(name, arch = detectArch(), version = ELECTRON_VERSION, outDir = process.cwd(), - overwrite = true, + overwrite = false, conceal = false, icon, badge = false, @@ -23,7 +23,15 @@ function optionsFactory(name, height = 800, callback) { if (!validator.isURL(targetUrl, {require_protocol: true})) { - throw 'Your Url is invalid!, did you remember to include \'http://\'?'; + throw `Your Url ${targetUrl} is invalid!, did you remember to include 'http://'?`; + } + + if (!width) { + width = 1280; + } + + if (!height) { + height = 800; } const options = {