File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,17 @@ if (typeof opts.ignore === 'string') {
48
48
var glob = require ( 'glob' ) ;
49
49
50
50
opts . _ . reduce ( function ( result , arg ) {
51
- // If glob does not match, `files` will be an empty array. Note: `glob.sync` may throw an error and crash the node process.
52
- var files = glob . sync ( arg ) ;
51
+ if ( glob . hasMagic ( arg ) ) {
52
+ // If glob does not match, `files` will be an empty array. Note: `glob.sync` may throw an error and crash the node process.
53
+ var files = glob . sync ( arg ) ;
53
54
54
- if ( ! Array . isArray ( files ) ) {
55
- throw new TypeError ( 'unknown error: glob.sync did not return an array or throw. Please report this.' ) ;
56
- }
55
+ if ( ! Array . isArray ( files ) ) {
56
+ throw new TypeError ( 'unknown error: glob.sync did not return an array or throw. Please report this.' ) ;
57
+ }
57
58
58
- return result . concat ( files ) ;
59
+ return result . concat ( files ) ;
60
+ }
61
+ return result . concat ( arg ) ;
59
62
} , [ ] ) . filter ( function ( file ) {
60
63
return ! matcher || ! matcher . shouldIgnore ( file ) ;
61
64
} ) . forEach ( function ( file ) {
You can’t perform that action at this time.
0 commit comments