From fdcd5ca87674833f7bee4684a3a9c027a4ad731d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Rasc=C3=A3o?= Date: Fri, 27 Jun 2014 18:47:08 +0100 Subject: [PATCH] fix deps cli invocation when args are supplied loadCurrentScriptDeps_ obtains the current script being executed through: var file = process.argv[process.argv.length - 1]; it then uses the directory where this file is contained to load the deps.js file. If command line arguments are passed to the script (eg. node script.js -l) then deps.js will not be loaded since process.argv.length - 1 is -l --- lib/nclosurebase.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nclosurebase.js b/lib/nclosurebase.js index 544c769..e286065 100644 --- a/lib/nclosurebase.js +++ b/lib/nclosurebase.js @@ -315,7 +315,7 @@ nclosure.base.prototype.loadDependenciesFile = function(dir, file) { * @private */ nclosure.base.prototype.loadCurrentScriptDeps_ = function() { - var file = process.argv[process.argv.length - 1]; + var file = process.argv[1]; if (require('path').existsSync(file)) { var depsPath = !file ? null : this.settingsLoader_.getFileDirectory(file); if (depsPath) this.loadDependenciesFile(depsPath, 'deps.js');