panthro
panthro

Reputation: 24099

Grunt - ignore hidden files?

With recurse:

grunt.file.recurse('../products/', function callback(abspath, rootdir, subdir, filename) {
....

How can I get it so it ignores hidden files:

.DS_Store

Upvotes: 0

Views: 97

Answers (1)

Kristján
Kristján

Reputation: 18843

Check the filename provided to your callback, and bail out if you don't like it:

function callback(abspath, rootdir, subdir, filename) {
  if (filename.startsWith('.')) return;
  // Do things
}

Upvotes: 2

Related Questions