[Pkg-javascript-commits] [node-coveralls] 242/332: Use index.options object for determining getOptions()’ filepath

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 13:54:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-coveralls.

commit a67629c9de3395c353903effa000effd01458050
Author: Anna Henningsen <sqrt at entless.org>
Date:   Wed Apr 15 17:44:10 2015 +0200

    Use index.options object for determining getOptions()’ filepath
---
 lib/getOptions.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/getOptions.js b/lib/getOptions.js
index 78f1bf3..4c53e36 100644
--- a/lib/getOptions.js
+++ b/lib/getOptions.js
@@ -1,6 +1,7 @@
 var fs = require('fs');
 var path = require('path');
 var yaml = require('js-yaml');
+var index = require('../index');
 var logger = require('./logger')();
 var fetchGitData = require('./fetchGitData');
 
@@ -128,9 +129,8 @@ var getOptions = function(cb, _userOptions){
   var userOptions = _userOptions || {};
 
   getBaseOptions(function(err, options){
-    // try to get filepath from the command-line
-    // look into all command line arguments from index 2 which don't start with -
-    var firstNonOptionArgument = process.argv.slice(2).filter(RegExp.prototype.test.bind(/^[^-]/))[0];
+    // minimist populates options._ with non-option command line arguments
+    var firstNonOptionArgument = index.options._[0];
     
     if (firstNonOptionArgument)
       options.filepath = firstNonOptionArgument;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git



More information about the Pkg-javascript-commits mailing list