[fix] Lazy-load any CLI arguments from optimist
This commit is contained in:
parent
8a3172868e
commit
e631d239d5
1 changed files with 5 additions and 2 deletions
|
@ -6,7 +6,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var async = require('async'),
|
var async = require('async'),
|
||||||
optimist = require('optimist'),
|
|
||||||
common = require('./common'),
|
common = require('./common'),
|
||||||
stores = require('./stores');
|
stores = require('./stores');
|
||||||
|
|
||||||
|
@ -236,7 +235,11 @@ Provider.prototype.__defineGetter__('useArgv', function () {
|
||||||
//
|
//
|
||||||
Provider.prototype.__defineSetter__('useArgv', function (val) {
|
Provider.prototype.__defineSetter__('useArgv', function (val) {
|
||||||
this._useArgv = val || false;
|
this._useArgv = val || false;
|
||||||
this.overrides = this.overrides || optimist.argv;
|
|
||||||
|
if (this._useArgv) {
|
||||||
|
this._argv = this._argv || require('optimist').argv;
|
||||||
|
this.overrides = this.overrides || this._argv;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue