init
This commit is contained in:
15
.editorconfig
Normal file
15
.editorconfig
Normal file
@@ -0,0 +1,15 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[package.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* text=auto
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
14
.jshintrc
Normal file
14
.jshintrc
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"node": true,
|
||||
"esnext": true,
|
||||
"bitwise": true,
|
||||
"camelcase": true,
|
||||
"curly": true,
|
||||
"immed": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"undef": true,
|
||||
"unused": "vars",
|
||||
"strict": true,
|
||||
"mocha": true
|
||||
}
|
||||
1
.npmignore
Normal file
1
.npmignore
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
6
.travis.yml
Normal file
6
.travis.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- 'iojs'
|
||||
- '0.12'
|
||||
- '0.10'
|
||||
30
.vscode/launch.json
vendored
Normal file
30
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"program": "test.js",
|
||||
"stopOnEntry": false,
|
||||
"args": [],
|
||||
"cwd": ".",
|
||||
"runtimeExecutable": null,
|
||||
"runtimeArgs": [
|
||||
"--nolazy"
|
||||
],
|
||||
"env": {
|
||||
"NODE_ENV": "development"
|
||||
},
|
||||
"externalConsole": false,
|
||||
"sourceMaps": false,
|
||||
"outDir": null
|
||||
},
|
||||
{
|
||||
"name": "Attach",
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"port": 5858
|
||||
}
|
||||
]
|
||||
}
|
||||
31
index.js
Normal file
31
index.js
Normal file
@@ -0,0 +1,31 @@
|
||||
'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();
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
21
license
Normal file
21
license
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Tommy Parnell <tparnell8@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
32
package.json
Normal file
32
package.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "gulp-nuget-restore",
|
||||
"version": "0.0.0",
|
||||
"description": "",
|
||||
"license": "MIT",
|
||||
"repository": "tparnell8/gulp-nuget-restore",
|
||||
"author": {
|
||||
"name": "Tommy Parnell",
|
||||
"email": "tparnell8@gmail.com",
|
||||
"url": "https://github.com/tparnell8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"nuget.exe"
|
||||
],
|
||||
"keywords": [
|
||||
"gulpplugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"gulp-util": "^3.0.1",
|
||||
"through2": "^0.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
}
|
||||
}
|
||||
43
readme.md
Normal file
43
readme.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# gulp-nuget-restore [](https://travis-ci.org/tparnell8/gulp-nuget-restore)
|
||||
|
||||
> My dazzling gulp plugin
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save-dev gulp-nuget-restore
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var gulp = require('gulp');
|
||||
var nugetRestore = require('gulp-nuget-restore');
|
||||
|
||||
gulp.task('default', function () {
|
||||
return gulp.src('src/file.ext')
|
||||
.pipe(nugetRestore())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### nugetRestore(options)
|
||||
|
||||
#### options
|
||||
|
||||
##### foo
|
||||
|
||||
Type: `boolean`
|
||||
Default: `false`
|
||||
|
||||
Lorem ipsum.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Tommy Parnell](https://github.com/tparnell8)
|
||||
21
test.js
Normal file
21
test.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
var assert = require('assert');
|
||||
var gutil = require('gulp-util');
|
||||
var nugetRestore = require('./');
|
||||
|
||||
var cb = function(){};
|
||||
var stream = nugetRestore();
|
||||
|
||||
stream.on('data', function (file) {
|
||||
assert.strictEqual(file.contents.toString(), 'unicorns');
|
||||
});
|
||||
|
||||
stream.on('end', cb);
|
||||
|
||||
stream.write(new gutil.File({
|
||||
base: __dirname,
|
||||
path: __dirname + '/file.ext',
|
||||
contents: new Buffer('unicorns')
|
||||
}));
|
||||
|
||||
stream.end();
|
||||
Reference in New Issue
Block a user