commit 04386ddf326c1e18d89cb531096fca0d2df1e979 Author: Tommy Parnell Date: Thu Feb 4 20:02:24 2016 -0500 init diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..86c8f59 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..027ef9d --- /dev/null +++ b/.jshintrc @@ -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 +} diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dedfc07 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +sudo: false +language: node_js +node_js: + - 'iojs' + - '0.12' + - '0.10' diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..5de2315 --- /dev/null +++ b/.vscode/launch.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..7cf888f --- /dev/null +++ b/index.js @@ -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(); + }); + + }); +}; diff --git a/license b/license new file mode 100644 index 0000000..e9d5642 --- /dev/null +++ b/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Tommy Parnell + +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. diff --git a/nuget.exe b/nuget.exe new file mode 100644 index 0000000..9f8781d Binary files /dev/null and b/nuget.exe differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..71719b9 --- /dev/null +++ b/package.json @@ -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": "*" + } +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..358772c --- /dev/null +++ b/readme.md @@ -0,0 +1,43 @@ +# gulp-nuget-restore [![Build Status](https://travis-ci.org/tparnell8/gulp-nuget-restore.svg?branch=master)](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) diff --git a/test.js b/test.js new file mode 100644 index 0000000..371d1c1 --- /dev/null +++ b/test.js @@ -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(); \ No newline at end of file