Skip globbing filenames with node-glob when the filename is not a glob (#1307)

* add a check to skip node-glob if the filename is not a glob

* add a return to prevent extra globbing
master
Hawken Rives 2017-04-16 23:12:49 -05:00 committed by Christopher Chedeau
parent d6e5e6be60
commit 3e5b123c37
1 changed files with 5 additions and 0 deletions

View File

@ -290,6 +290,11 @@ if (stdin) {
function eachFilename(patterns, callback) {
patterns.forEach(pattern => {
if (!glob.hasMagic(pattern)) {
callback(pattern);
return;
}
glob(pattern, (err, filenames) => {
if (err) {
console.error("Unable to expand glob pattern: " + pattern + "\n" + err);