Permalink
Browse files

Allow Glob options

  • Loading branch information...
1 parent e940f04 commit 5c873081b1835978b66961d21ed701200bfc77a7 @pierrec pierrec committed Mar 11, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/fileset.js
View
@@ -1,15 +1,13 @@
-
-
-
var util = require('util'),
minimatch = require('minimatch'),
Glob = require('glob').Glob,
EventEmitter = require('events').EventEmitter;
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'))

0 comments on commit 5c87308

Please sign in to comment.