tartley / rerun2

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

Fixed error: printf: 0.250: invalid number #16

Closed denilsonsa closed 1 year ago

denilsonsa commented 1 year ago

When running rerun2 on my system:

/home/denilsonsa/bin/rerun2: line 64: printf: 0.250: invalid number

This unfortunately seems to happen due to some locale setting that makes comma as the decimal separator:

LC_NUMERIC=nl_NL.UTF-8

Alternatively, we could directly specify the cooldown constant as nanoseconds, avoiding the conversion done through printf and sed.

tartley commented 1 year ago

Thanks for the PR. I'm happy to gratefully merge this. But also, am curious about the suggestion to store cooldown in nanoseconds, since that would make the code slightly simpler. Let me try that out. If it results on overall simpler coder I'll publish a PR as an alternative to this.

tartley commented 1 year ago

Nah, now I've remembered what this code looks like, I prefer your fix. Thank you!