handlebars.js icon indicating copy to clipboard operation
handlebars.js copied to clipboard

Precompiler doesn't take directories as input

Open anghenfil opened this issue 1 month ago • 3 comments

Hey,

I'm trying to use a directory (with subdirectories) as source for the handlebars cli, but every time I use a valid directory (e.g. handlebars test/ -f out.js) it just returns the help/usage advice.

Since the help states Usage: handlebars [template|directory]... I expected the command above to work. I'm on handlebars 4.7.8.

Best anghenfil

anghenfil avatar Nov 11 '25 16:11 anghenfil

Did you try handlebars ./test/ -f out.js?

jaylinski avatar Nov 11 '25 19:11 jaylinski

@jaylinski Yes, it will also just print the help/usage text

anghenfil avatar Nov 12 '25 16:11 anghenfil

I just checked the code. It simply uses the input from the terminal (eg by using bash path name expansion).

So this works: handlebars ./test/*.hbs -f out.js because the shell expands ./test/*.hbs into ./test/file.hbs (for example).

Documentation could be improved here.

jaylinski avatar Nov 12 '25 23:11 jaylinski