-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
37 lines (30 loc) · 1.06 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(function () {
var gulp = require('gulp'),
util = require('gulp-util'),
shell = require('gulp-shell'),
request = require('request'),
fs = require('fs');
const PLUGIN_NAME = "gulp-nuget-packages";
function gulpNugetPackages(config){
if(!config.solutionPath || config.solutionPath == ""){
throw new util.PluginError(PLUGIN_NAME, "solution path was not provided");
}
if(!config.sln || config.sln == ""){
throw new util.PluginError(PLUGIN_NAME, "sln file was not provided");
}
if(!config.nugetPath || config.nugetPath == ""){
throw new util.PluginError(PLUGIN_NAME, "path to nuget.exe was not provided");
}
var cmds = [
'nuget restore "' + config.solutionPath + '/' + config.sln +'"'
];
var conf = {
cwd: config.nugetPath
};
gulp.src('')
.pipe(shell(cmds, conf))
.on('error', util.log);
return gulp.src('');
}
module.exports = gulpNugetPackages;
})();