From e7481790f35554cc48391580d8b10dc4c306f6bd Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Mon, 8 Feb 2016 17:33:17 -0500 Subject: [PATCH] allow optional args to be passed in #1 --- index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 044649b..fd4c736 100644 --- a/index.js +++ b/index.js @@ -8,17 +8,19 @@ module.exports = function (options) { var nugetPath = __dirname + "./nuget.exe"; var monoPath = null; var targetFile = nugetPath; - var cmdArgs = ["restore"] - + var cmdArgs = ["restore"]; + if(options){ nugetPath = options.nugetPath || nugetPath; - monoPath = options.monoPath || monoPath + monoPath = options.monoPath || monoPath; + if(options.nugetArguments && options.nugetArguments.length > 0){ + cmdArgs = cmdArgs.concat(options.nugetArguments); + } } if(monoPath && monoPath.length > 0){ targetFile = monoPath; cmdArgs.unshift(nugetPath); } - return through.obj(function (file, enc, cb) { if (!file || !file.path) { cb(null, file);