Gaurav_soni
Gaurav_soni

Reputation: 6114

File path format in grunt

I have a grunt file generated by Yomen , there is a file path define as

test: {
  options: {
    jshintrc: 'test/.jshintrc'
  },
  src: ['test/spec/{,*/}*.js']
}

What is the meaning of 'test/spec/{,*/}*.js' what does it match ? also I have seen many places js/**/*.js , does this mean all the folders in js ?

Upvotes: 2

Views: 41

Answers (1)

cartant
cartant

Reputation: 58400

According to the node-glob documentation, the brace-enclosed portion of the glob expands the comma-delimited sections within the braces. So this:

['test/spec/{,*/}*.js']

should expand to this:

['test/spec/*.js', 'test/spec/*/*.js']

matching any .js files in test/spec or in any directory immediately under test/spec.

That's a slightly different to 'test/spec/**/*.js', which will match any .js files in test/spec and in any directory - no matter how deep - under test/spec.

Upvotes: 4

Related Questions