Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

Commit

Permalink
removed npm module 'yargs'
Browse files Browse the repository at this point in the history
  • Loading branch information
eisenkolb committed Sep 8, 2015
1 parent e7bde2e commit 4f2f245
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"gulp-watch": "^4.2.4",
"q": "^1.4.1",
"tree-kill": "^0.1.1",
"vinyl-map": "^1.0.1",
"yargs": "^3.13.0"
"vinyl-map": "^1.0.1"
},
"optionalDependencies": {
"appdmg": "^0.3.2",
Expand Down
6 changes: 2 additions & 4 deletions tasks/app_npm_install.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

var childProcess = require('child_process');
var jetpack = require('fs-jetpack');
var argv = require('yargs').argv;

var utils = require('./utils');

var electronVersion = utils.getElectronVersion();
Expand All @@ -33,8 +31,8 @@ process.env.npm_config_target = electronVersion;

var params = ['install'];
// Maybe there was name of package user wants to install passed as a parameter.
if (argv._.length > 0) {
params.push(argv._[0]);
if (process.argv.length > 2) {
params.push(process.argv[2]);
params.push('--save');
}

Expand Down
11 changes: 9 additions & 2 deletions tasks/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

var argv = require('yargs').argv;
var os = require('os');
var jetpack = require('fs-jetpack');

Expand All @@ -25,7 +24,15 @@ module.exports.replace = function (str, patterns) {
};

module.exports.getEnvName = function () {
return argv.env || 'development';
var environment = "development";

process.argv.forEach(function(args) {
if (args.indexOf("--env") === 0){
environment = args.split("--env=")[1];
}
});

return environment;
};

module.exports.getElectronVersion = function () {
Expand Down

0 comments on commit 4f2f245

Please sign in to comment.