postcss/postcss-cli

glob pattern is not working as expected on linux

Th3S4mur41 opened this issue · 1 comments

Following this folder structure:

src
  index.css
  reset.css
  elements
    input.css
    dialog.css

Running postcss src/**/*.css -d dist --base src --no-map on windows will create as expected the exact same structure in the dist folder.

dist
  index.css
  reset.css
  elements
    input.css
    dialog.css

On Linux however, index.css and reset.css are missing from the dist folder

dist
  elements
    input.css
    dialog.css

It looks like it is not interpreting the ** as a recursive match zero or more directories.
Wrapping the pattern in quotes, fixes the issue: postcss "src/**/*.css" -d dist --base src --no-map

On operating systems other than Windows, unquoted globs are interpreted by your shell. Globstar (**) is not enabled by default on most Linuxes; see https://askubuntu.com/a/1010708 for how to enable it. Either you must enable globstar or quote the parameter.