regexnpmbowerglobminimatch

Glob / minimatch: How to get sub folders?


I would like to copy the complete folder structure (without first level files) of a bower component into my web project.

The structure of the source projects looks like this:

bower_components/roboto-fontface-bower/css/
bower_components/roboto-fontface-bower/fonts/
bower_components/roboto-fontface-bower/.bower.json
bower_components/roboto-fontface-bower/bower.json
bower_components/roboto-fontface-bower/LICSENSE
bower_components/roboto-fontface-bower/package.json
bower_components/roboto-fontface-bower/README.md

I would like to get the folder css (with included files) and fonts (with includes files).

My current minimatch pattern is:

"bower_components/roboto-fontface-bower/**"

With my current pattern, the files .bower.json, bower.json, etc. are also copied which is what I don't want. How can I only get the two folders (css & fonts)?

I tried "bower_components/roboto-fontface-bower/{css/,fonts/}" but this copies nothing.


Solution

  • Try bower_components/roboto-fontface-bower/{css,fonts}/*

    You can test it using globster.xyz