diff --git a/lib/__tests__/fixtures/globs/a(b)/styles.css b/lib/__tests__/fixtures/globs/a(b)/styles.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/a(b)/styles.css @@ -0,0 +1 @@ +a {} diff --git a/lib/__tests__/standalone-globs.test.js b/lib/__tests__/standalone-globs.test.js index 2f3f486287..0d9d2c8255 100644 --- a/lib/__tests__/standalone-globs.test.js +++ b/lib/__tests__/standalone-globs.test.js @@ -21,6 +21,7 @@ describe('standalone globbing', () => { // ref https://github.com/micromatch/micromatch#matching-features const fixtureDirs = [ `[digit]/not-digits`, + `a(b)`, `with spaces`, `extglob!(s)`, `got!negate/negate`, diff --git a/lib/standalone.js b/lib/standalone.js index e92d9c1946..0f5b46a2dc 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -172,14 +172,12 @@ module.exports = function (options) { } fileList = fileList.map((entry) => { - if (globby.hasMagic(entry)) { - const cwd = _.get(globbyOptions, 'cwd', process.cwd()); - const absolutePath = !path.isAbsolute(entry) ? path.join(cwd, entry) : path.normalize(entry); + const cwd = _.get(globbyOptions, 'cwd', process.cwd()); + const absolutePath = !path.isAbsolute(entry) ? path.join(cwd, entry) : path.normalize(entry); - if (fs.existsSync(absolutePath)) { - // This glob-like path points to a file. Return an escaped path to avoid globbing - return fastGlob.escapePath(entry); - } + if (fs.existsSync(absolutePath)) { + // This path points to a file. Return an escaped path to avoid globbing + return fastGlob.escapePath(entry); } return entry;