From 87f5572bfb61230224e7b037ad144817dd74791d Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Fri, 17 Apr 2015 09:54:29 -0400 Subject: [PATCH] Use minimist for parsing args --- gulpfile.js | 13 ++++++------- package.json | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 1146a693e2..4c1b05b3e2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,7 +17,7 @@ var shell = require('gulp-shell'); var sourcemaps = require('gulp-sourcemaps'); var dependencies = Object.keys(packagejson.dependencies); -var isBeta = process.argv.indexOf('--beta') !== -1; +var argv = require('minimist')(process.argv.slice(2)); var settings; try { @@ -25,15 +25,15 @@ try { } catch (err) { settings = {}; } -settings.beta = isBeta; +settings.beta = argv.beta; var options = { dev: process.argv.indexOf('release') === -1, - beta: isBeta, - appFilename: isBeta ? 'Kitematic (Beta).app' : 'Kitematic.app', - appName: isBeta ? 'Kitematic (Beta)' : 'Kitematic', + beta: argv.beta, + appFilename: argv.beta ? 'Kitematic (Beta).app' : 'Kitematic.app', + appName: argv.beta ? 'Kitematic (Beta)' : 'Kitematic', name: 'Kitematic', - icon: isBeta ? './util/kitematic-beta.icns' : './util/kitematic.icns', + icon: argv.beta ? './util/kitematic-beta.icns' : './util/kitematic.icns', bundle: 'com.kitematic.kitematic' }; @@ -63,7 +63,6 @@ gulp.task('styles', function () { return gulp.src('styles/main.less') .pipe(plumber(function(error) { gutil.log(gutil.colors.red('Error (' + error.plugin + '): ' + error.message)); - // emit the end event, to properly end the task this.emit('end'); })) .pipe(gulpif(options.dev, changed('./build'))) diff --git a/package.json b/package.json index 3059ca6d93..87509623c8 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "dockerode": "^2.1.1", "exec": "0.2.0", "jquery": "^2.1.3", - "minimist": "^1.1.0", "mixpanel": "0.0.20", "node-uuid": "^1.4.2", "object-assign": "^2.0.0", @@ -74,7 +73,6 @@ }, "devDependencies": { "babel": "^4.5.5", - "gulp": "^3.8.11", "gulp-babel": "^4.0.0", "gulp-changed": "^1.1.1", "gulp-concat": "^2.5.2", @@ -89,8 +87,10 @@ "gulp-shell": "^0.3.0", "gulp-sourcemaps": "^1.5.0", "gulp-util": "^3.0.4", + "gulp": "^3.8.11", "jest-cli": "kitematic/jest", "jsxhint": "^0.12.1", + "minimist": "^1.1.0", "react-tools": "^0.12.2", "run-sequence": "^1.0.2" }