gulp-choose-files
Advanced tools
Comparing version 0.1.1 to 0.1.2
22
index.js
@@ -8,3 +8,3 @@ 'use strict'; | ||
module.exports = function(options) { | ||
var opts = extend({prop: 'relative'}, options); | ||
var opts = extend({key: 'relative', save: false}, options); | ||
var msg = opts.message || 'Which files do you want to write?'; | ||
@@ -16,2 +16,7 @@ var questions = new Questions(); | ||
return through.obj(function(file, enc, next) { | ||
if (opts.skip) { | ||
next(null, file); | ||
return; | ||
} | ||
var key = fileKey(file, opts); | ||
@@ -23,4 +28,17 @@ paths.push(key); | ||
var stream = this; | ||
if (typeof opts.choices === 'string') { | ||
opts.choices = [opts.choices]; | ||
} | ||
if (Array.isArray(opts.choices)) { | ||
opts.choices.forEach(function(filepath) { | ||
stream.push(files[filepath]); | ||
}); | ||
next(); | ||
return; | ||
} | ||
questions.choices('files', msg, paths); | ||
questions.ask('files', function(err, answers) { | ||
questions.ask('files', opts, function(err, answers) { | ||
if (err || !answers.files) { | ||
@@ -27,0 +45,0 @@ next(err); |
{ | ||
"name": "gulp-choose-files", | ||
"description": "Gulp plugin that prompts you to choose the files pass through the stream.", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/jonschlinkert/gulp-choose-files", | ||
"description": "Gulp plugin that prompts you to choose the files to pass through the stream.", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/generate/gulp-choose-files", | ||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"repository": "jonschlinkert/gulp-choose-files", | ||
"repository": "generate/gulp-choose-files", | ||
"bugs": { | ||
"url": "https://github.com/jonschlinkert/gulp-choose-files/issues" | ||
"url": "https://github.com/generate/gulp-choose-files/issues" | ||
}, | ||
@@ -28,7 +28,7 @@ "license": "MIT", | ||
"devDependencies": { | ||
"assemble": "^0.11.0", | ||
"assemble": "^0.14.0", | ||
"engine-handlebars": "^0.8.0", | ||
"gulp": "^3.9.1", | ||
"gulp-format-md": "^0.1.9", | ||
"mocha": "^2.4.5" | ||
"mocha": "^2.5.3" | ||
}, | ||
@@ -43,2 +43,3 @@ "keywords": [ | ||
"gulpplugin", | ||
"pick", | ||
"prompt", | ||
@@ -59,3 +60,2 @@ "question", | ||
"related": { | ||
"description": "Other gulp plugins I maintain", | ||
"list": [ | ||
@@ -62,0 +62,0 @@ "gulp-condense", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3879
53