File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 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') {
4848var glob = require ( 'glob' ) ;
4949
5050opts . _ . 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 ) ;
5354
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+ }
5758
58- return result . concat ( files ) ;
59+ return result . concat ( files ) ;
60+ }
61+ return result . concat ( arg ) ;
5962} , [ ] ) . filter ( function ( file ) {
6063 return ! matcher || ! matcher . shouldIgnore ( file ) ;
6164} ) . forEach ( function ( file ) {
You can’t perform that action at this time.
0 commit comments