cespare / reflex

Run a command when files change

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1.6beta2 on OSX

pkieltyka opened this issue · comments

I can't seem to get reflex to work.. perhaps I'm using it incorrectly.. im doing reflex -g * -- echo hi I've also tried reflex -g ./* echo hi .. nothing happens when I change those files

Thanks for the report. I'll take a look.

Hi @pkieltyka,

The way you're invoking reflex, the * is expanded by your shell, so if you have (for example) a.txt and b.txt in your current directory, reflex sees

reflex -g a.txt b.txt -- echo hi

So then if you change b.txt, nothing happens; if you change a.txt, then reflex will try to run b.txt, which is definitely not what you intended.

If you really want to run a change after any file changes, you shouldn't provide -g (or -r) -- by default, reflex considers all file changes in the current directory.

reflex echo hi

If you want to use a glob pattern with a *, you'll want to quote it:

reflex -g 'foo*' -- echo hi

Finally, use -v if you're ever not sure what reflex is doing -- it will print out exactly the configuration that it's using so you can see what's going on.

Hope this helps!

thanks it certainly helps! and it works perfectly.