File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -47,17 +47,19 @@ if (typeof opts.ignore === 'string') {
4747
4848var glob = require ( 'glob' ) ;
4949
50- opts . _ . forEach ( function ( arg ) {
50+ opts . _ . reduce ( function ( result , arg ) {
5151 // If glob does not match, `files` will be an empty array. Note: `glob.sync` may throw an error and crash the node process.
5252 var files = glob . sync ( arg ) ;
5353
5454 if ( ! Array . isArray ( files ) ) {
5555 throw new TypeError ( 'unknown error: glob.sync did not return an array or throw. Please report this.' ) ;
5656 }
5757
58- files . filter ( function ( file ) { return ! matcher || ! matcher . shouldIgnore ( file ) ; } ) . forEach ( function ( file ) {
59- require ( resolvePath ( cwd , file ) ) ;
60- } ) ;
58+ return result . concat ( files ) ;
59+ } , [ ] ) . filter ( function ( file ) {
60+ return ! matcher || ! matcher . shouldIgnore ( file ) ;
61+ } ) . forEach ( function ( file ) {
62+ require ( resolvePath ( cwd , file ) ) ;
6163} ) ;
6264
6365// vim: ft=javascript
You can’t perform that action at this time.
0 commit comments