cespare / reflex

Run a command when files change
MIT License
3.35k stars 135 forks source link

Implement recursive globbing (globstar) #17

Closed cespare closed 8 years ago

cespare commented 10 years ago

reflex -g '**/*.go' should work as in bash with globstar.

tammersaleh commented 9 years ago

I'd also love to see this. Wish I was a better go dev so I could send in a PR.

cespare commented 8 years ago

I think it's fine to not implement this. -r is easy enough to use in these cases.

pjeby commented 6 years ago

I've implemented a proof of concept for this using godo's globstar implementation -- with this approach it's possible to drop the globMatcher altogether and use only regex matchers. Apart from the addition of the Globexp function and some additional test cases, everything else is pretty much deleting/simplifying code. Any interest in a PR?

(Btw, I'd dispute the statement that "-r is easy enough to use", as a simple glob like **/.*.md translates into the non-trivial regex (^|/)\.[^/]*.md$. Translating recursive globs to correct regular expressions is hard to do by hand, but straightforward to do by machine.)