guardian icon indicating copy to clipboard operation
guardian copied to clipboard

processing executable files

Open mackuba opened this issue 6 years ago • 4 comments

Is there any specific reason why executable files have to be excluded from processing by guardian (https://github.com/f/guardian/blob/master/src/guardian/watcher.cr#L57)?

I have a repo with some very simple Crystal programs (tasks for AdventOfCode) that I've all marked executable (with the hashbang line #!/usr/bin/env crystal run) so that I can run them from the command line easily, and now I've installed guardian to see if it make things more convenient, but it took me a while to figure out why it didn't work at all when I told it to watch ./**/*.cr...

mackuba avatar Dec 07 '18 12:12 mackuba

I guess this was added to prevent execution loops caused by newly created executables like crystal usually does. I'll add an option to include executable files later, it's a use case some people have i guess.

f1reflyyyylmao avatar Dec 08 '18 11:12 f1reflyyyylmao

Ah, good point. This only really applies to files without extensions, but they may be caught accidentally by a lot of rules and it would be hard to detect this automatically. Additional option to include executable files for specific rules only could make sense.

mackuba avatar Dec 08 '18 13:12 mackuba

Yeah, exacty my thoughts :)

f1reflyyyylmao avatar Dec 08 '18 13:12 f1reflyyyylmao

Any opinions on this @f ?

f1reflyyyylmao avatar Dec 09 '18 09:12 f1reflyyyylmao