diff --git a/lib/standalone.js b/lib/standalone.js index 34190d312b..fd0ff02063 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -184,6 +184,20 @@ module.exports = function (options) { fileCache.destroy(); } + // Escape square brackets + fileList = fileList.map((p) => { + let result = p; + + if (result.match(/[[\]]/g)) { + result = result.split('[').join('\\['); + result = result.split(']').join('\\]'); + + return result; + } + + return p; + }); + return globby(fileList, globbyOptions) .then((filePaths) => { // The ignorer filter needs to check paths relative to cwd