Skip to content

Commit

Permalink
Allow Glob options
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrec committed Mar 11, 2012
1 parent e940f04 commit 5c87308
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/fileset.js
Original file line number Diff line number Diff line change
@@ -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(' '),
Expand All @@ -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'))
Expand Down

0 comments on commit 5c87308

Please sign in to comment.