Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glob Sync Pattern on multiple directories

I am trying to achieve a glob sync pattern that allows me to meet the following criteria, but unfortunately, im having a hard time working out why the pattern isn't working.

Glob Pattern

glob.sync("./src/handlebar/{a, b, c, d}/**/*.hbs")

File Path Patterns

src/handlebar/b/a/header.hbs
src/handlebar/b/header.hbs
src/handlebar/a/head.hbs [MATCH]
src/handlebar/a/foot.hbs [MATCH]
src/handlebar/c/a/something.hbs
src/handlebar/d/a/button.hbs

What am i doing wrong?

like image 631
Sophie Rhodes Avatar asked Aug 18 '18 10:08

Sophie Rhodes


1 Answers

Spaces are the problem, try:

glob.sync("./src/handlebar/{a,b,c,d}/**/*.hbs")
like image 192
m1ch4ls Avatar answered Oct 15 '22 06:10

m1ch4ls