arctic-hen7 / bonnie

Simple, cross-platform, and fast command aliases with superpowers.
MIT License
83 stars 6 forks source link

Add ability to rerun command on directory change #22

Open arctic-hen7 opened 3 years ago

arctic-hen7 commented 3 years ago

Description A new command core property (lowest level, next to shell/exec specification) .watch that is provided a directory path to watch. Then, the command will be rerun whenever any file in that directory changes.

Reasoning This would make Bonnie able to easily run commands that need to watch one or more files. Quite frankly, it'd just be a useful feature. The only possible issue is that we'd need to assume the directory exists until runtime, and we'll have to check it before we run the command for the first time (on invocation) and fail fast, but that shouldn't be a problem.

Are you willing to work on an implementation of this? Yes.

arctic-hen7 commented 3 years ago

Having played around a little with watching directories in Perseus, I think I'm reasonably familiar with what needs to be done for this, but it's definitely lower priority than the other open issues at the moment.