Closed tmaier closed 2 months ago
In theory the double asterisk should already recurse subdirectories, maybe it's not enabled in your shell env?
For bash you should be able to enable it with shopt -s globstar
, see https://askubuntu.com/a/1010708.
I want to use a tool called "erb-format" to format all my
*.html.erb
and*.turbo_stream.erb
files.The issue is, it supports globs just poorly. One would need to run the following to format all the files:
bin/erb-format **/*.{html,turbo_stream}.erb --write
bin/erb-format **/**/*.{html,turbo_stream}.erb --write
bin/erb-format **/**/**/*.{html,turbo_stream}.erb --write
bin/erb-format **/**/**/**/*.{html,turbo_stream}.erb --write
When any of them would not find a file, it raises an error like
No such file or directory @ rb_sysopen - app/**/*.turbo_stream.erb (Errno::ENOENT)
I think
Dir.glob
could solve this...