diff --git a/bin/tape b/bin/tape index f774228f..2783f5da 100755 --- a/bin/tape +++ b/bin/tape @@ -48,14 +48,17 @@ if (typeof opts.ignore === 'string') { var glob = require('glob'); opts._.reduce(function (result, arg) { - // If glob does not match, `files` will be an empty array. Note: `glob.sync` may throw an error and crash the node process. - var files = glob.sync(arg); + if (glob.hasMagic(arg)) { + // If glob does not match, `files` will be an empty array. Note: `glob.sync` may throw an error and crash the node process. + var files = glob.sync(arg); - if (!Array.isArray(files)) { - throw new TypeError('unknown error: glob.sync did not return an array or throw. Please report this.'); - } + if (!Array.isArray(files)) { + throw new TypeError('unknown error: glob.sync did not return an array or throw. Please report this.'); + } - return result.concat(files); + return result.concat(files); + } + return result.concat(arg); }, []).filter(function (file) { return !matcher || !matcher.shouldIgnore(file); }).forEach(function (file) {