Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow Glob options

  • Loading branch information...
commit 5c873081b1835978b66961d21ed701200bfc77a7 1 parent e940f04
@pierrec pierrec authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/fileset.js
View
8 lib/fileset.js
@@ -1,6 +1,3 @@
-
-
-
var util = require('util'),
minimatch = require('minimatch'),
Glob = require('glob').Glob,
@@ -8,8 +5,9 @@ var util = require('util'),
module.exports = fileset;
-function fileset(include, exclude, cb) {
+function fileset(include, exclude, options, cb) {
if (typeof exclude === 'function') cb = exclude, exclude = '';
+ else if (typeof options === 'function') cb = options, options = {};
var em = new EventEmitter,
includes = include.split(' '),
@@ -20,7 +18,7 @@ function fileset(include, exclude, cb) {
if(!includes.length) return cb(new Error('Must provide an include pattern'));
em.includes = includes.map(function(pattern) {
- return new fileset.Fileset(pattern)
+ return new fileset.Fileset(pattern, options)
.on('error', cb ? cb : em.emit.bind(em, 'error'))
.on('match', em.emit.bind(em, 'match'))
.on('match', em.emit.bind(em, 'include'))
Please sign in to comment.
Something went wrong with that request. Please try again.