tartley / rerun2

Rerun a given command (eg tests) on filesystem events
MIT License
98 stars 21 forks source link

fix: "invalid arithmetic operator" error #14

Closed nestor-custodio closed 1 year ago

nestor-custodio commented 1 year ago

Fixes #13.

This also eliminates a lot of string manipulation by defining the cooldown in seconds and doing all comparisons on nanosecond timestamps. It does introduce one printf call and one sed invocation, but these happen outside of the inotify/wait loop, so are only called once.

Worth noting:


If/when this PR is approved and merged, I'll have a follow-up PR for several issues I've identified relating to --verbose behaviour (and $changes management) being broken:

* Note that by "temp file" I mean an actual temp file or possibly a shared memory location that is accessible across the two shells. Again, this will be implemented in a forthcoming PR and I'll be sure to document how/why I landed on one option vs the other.

karlovsek commented 1 year ago

Thank you for the fix!

tartley commented 1 year ago

Indeed, thank you for the fix. Apologies for being silent about it. I am excited to check it out and merge...

Also: I have recently had some exciting ideas around the concept of 'rerun2', and maybe if you are interested in this repo, you might be interested. At the very least, they might result in 'rerun2' gaining some new cmdline options to exercise more control over which files are watched or ignored (and then using rerun2 from some other closely related scripts, which are useful both from the command-line, and from a GUI). I'll post a description as a new issue.

tartley commented 1 year ago

Thanks again, this is brilliant.