Here's a tool I wrote for retrying fallible commands. Nothing groundbreaking here, this is a tool that's been made many times (and several have been submitted to Show HN). Though this one does have a more comprehensive feature set than most. I hope one or two people will find it useful.
I wrote `attempt` for two reasons:
- To have a more featureful alternative to `wait-for-it.sh` for use in Docker Compose. Specifically to apply migration scripts to a database that may not be up yet. I wanted to be able to inspect the error messages from my migration tool & retry on connection errors.
- To test a hypothesis I had that a good way to make a CLI was to copy the API of a good library (in this case, `tenacity`). I want to write a blog post at some point to discuss this at length, but the tl;dr is that I believe it was a success.
Here are some usage examples: https://maxbondabe.github.io/attempt/usage.html
There may not be much to discuss for such a small tool, but I am open to all feedback and am happy to answer any questions.
Cheers,
Max
adastra22•6h ago
maxbond•6h ago
onionisafruit•6h ago
SparkyMcUnicorn•5h ago