Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does `{,*/}` mean in paths of Gruntfile.js?

In Gruntfile.js, I have got:

watch: {
    styles: {
      files: [
        '<%= yeoman.app %>/styles/{,*/}*.less'
      ],
      tasks: ['copy:styles', 'autoprefixer']
    }
}

For the path, what does {,*/} mean indeed? How does it differ to using double asterisks **/?

like image 268
hllau Avatar asked Oct 21 '13 03:10

hllau


1 Answers

These are globbing patterns for Grunt, supported by the node-glob and minimatch libraries.

Basically:

  • * matches any number of characters, but not /
  • ** matches any number of characters, including /, as long as it's the only thing in a path part
  • {} allows for a comma-separated list of "or" expressions

So, styles/{,*/}*.less matches the following files:

  • LESS files inside styles directory
  • LESS files inside direct sub-directories of styles directory (but no deeper)
like image 194
Rockallite Avatar answered Oct 06 '22 06:10

Rockallite