File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ if (typeof opts.ignore === 'string') {
41
41
var matcher = ignore . createMatcher ( ignoreStr ) ;
42
42
}
43
43
44
- opts . _ . forEach ( function ( arg ) {
44
+ var files = opts . _ . reduce ( function ( result , arg ) {
45
45
// If glob does not match, `files` will be an empty array.
46
46
// Note: `glob.sync` may throw an error and crash the node process.
47
47
var files = glob . sync ( arg ) ;
@@ -50,9 +50,13 @@ opts._.forEach(function (arg) {
50
50
throw new TypeError ( 'unknown error: glob.sync did not return an array or throw. Please report this.' ) ;
51
51
}
52
52
53
- files . filter ( function ( file ) { return ! matcher || ! matcher . shouldIgnore ( file ) ; } ) . forEach ( function ( file ) {
54
- require ( resolvePath ( cwd , file ) ) ;
55
- } ) ;
53
+ return result . concat ( files ) ;
54
+ } , [ ] ) . filter ( function ( file ) {
55
+ return ! matcher || ! matcher . shouldIgnore ( file ) ;
56
+ } ) . map ( function ( file ) {
57
+ return resolvePath ( cwd , file ) ;
56
58
} ) ;
57
59
60
+ files . forEach ( function ( x ) { require ( x ) ; } ) ;
61
+
58
62
// vim: ft=javascript
You can’t perform that action at this time.
0 commit comments