Files
gulp-nuget-restore/index.js
Tommy Parnell 04386ddf32 init
2016-02-04 20:02:24 -05:00

32 lines
775 B
JavaScript

'use strict';
var gutil = require('gulp-util');
var through = require('through2');
var execFile = require('child_process').execFile;
module.exports = function (options) {
var nugetPath = __dirname + "./nuget.exe";
var commandPrefix = "";
if(options){
nugetPath = options.nugetPath || nugetPath;
commandPrefix = options.commandPrefix || commandPrefix;
}
return through.obj(function (file, enc, cb) {
if (!file || !file.path) {
cb(null, file);
return;
}
execFile(nugetPath, ["restore", file.path], function(error, stdout, stderror){
console.log(stdout);
console.log(stderror);
if (error) {
throw error;
}
cb();
});
});
};