fstream-ignore
fstream-ignore copied to clipboard
Accept custom ignore rules in Ignore options
This is currently possible, but the solution only works because ._stat()
will be called in the next tick:
var Ignore = require('fstream-ignore');
var ignore = Ignore({
dir: '/path/to/read/files/from',
ignoreFiles: ['.gitignore']
});
ignore.addIgnoreRules(['ignore-this', 'and-this'], 'custom-rules');
ignore.on('child', function (c) {
console.dir(c.path);
});
Would prefer to pass this into the Ignore
constructor. Seems more appropriate with how streams work:
var Ignore = require('fstream-ignore');
Ignore({
dir: '/path/to/read/files/from',
ignoreFiles: ['.gitignore'],
ignoreRules: ['ignore-this', 'and-this']
}).on('child', function (c) {
console.dir(c.path);
});
Not a huge deal since there is a work-around, but would be nice to have :)
Agreed. Patch welcome :)
On Friday, January 4, 2013, Charlie Robbins wrote:
This is currently possible, but the solution only works because ._stat()will be called in the next tick:
var Ignore = require('fstream-ignore');
var ignore = Ignore({ dir: '/path/to/read/files/from', ignoreFiles: ['.gitignore'] });
ignore.addIgnoreRules(['ignore-this', 'and-this'], 'custom-rules');
ignore.on('child', function (c) { console.dir(c.path); });
Would prefer to pass this into the Ignore constructor. Seems more appropriate with how streams work:
var Ignore = require('fstream-ignore');
Ignore({ dir: '/path/to/read/files/from', ignoreFiles: ['.gitignore'], ignoreRules: ['ignore-this', 'and-this'] }).on('child', function (c) { console.dir(c.path); });
Not a huge deal since there is a work-around, but would be nice to have :)
— Reply to this email directly or view it on GitHubhttps://github.com/isaacs/fstream-ignore/issues/4.
vote +1
@isaacs could you please take a look to patch?
vote +1