From 168f3d9cec07cb4422ec60ed4be25af023b81988 Mon Sep 17 00:00:00 2001 From: "r.ushakov" Date: Tue, 12 Dec 2023 23:45:00 +0800 Subject: [PATCH] Fix glob application for patten provided in CLI arguments in Windows OS terminals (cmd, powershell) --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f80c786..58d8144 100755 --- a/index.js +++ b/index.js @@ -153,7 +153,8 @@ if (!module.parent) { * @param {function} callback */ function generate(files, options, callback) { - files = Array.isArray(files) ? files : glob.sync(files); + var isProvidedPattern = !Array.isArray(files) || files.length === 1; + files = isProvidedPattern ? glob.sync(files[0] || files) : files; if (files.length == 0) return callback(new Error('no files specified')); options = options || {};