postcss / postcss-cli

CLI for postcss
Other
824 stars 93 forks source link

glob pattern is not working as expected on linux #476

Closed Th3S4mur41 closed 1 month ago

Th3S4mur41 commented 1 month ago

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

RyanZim commented 1 month ago

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.