Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grunt Globbing patterns

What is the pattern needed to achieve the following.

  1. Match all the html file in the directory .tmp
  2. Match all the html file in .tmp/views and all subdirectories of it (recursively to any depth)

This is to register livereload task in Grunt file.

I tried few varieties of below config. It matches all files in .tmp, but not recursively in .tmp/views

Also tried,

 '.tmp/{,views/**/}*.html'

but the same result.

 livereload: {
                    options: {
                        livereload: LIVERELOAD_PORT
                    },
                    files: [
                        '.tmp/{,views/**}*.html'
                    ]
                }
like image 562
bsr Avatar asked Aug 05 '13 21:08

bsr


1 Answers

You should be able to get the matching you need by passing two elements in the files array:

files: [
    '.tmp/*.html',
    '.tmp/views/**/*.html',
]

This will match any .html files directly below .tmp/, as well as any .html file in .tmp/views/, whether directly under that directory or deeper (the /**/ part).

like image 57
Bojangles Avatar answered Oct 14 '22 21:10

Bojangles