https://github.com/homeport/retry
Tool to retry a command in case it fails
https://github.com/homeport/retry
buffered go retry
Last synced: 20 days ago
JSON representation
Tool to retry a command in case it fails
- Host: GitHub
- URL: https://github.com/homeport/retry
- Owner: homeport
- License: mit
- Created: 2022-07-22T07:42:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2026-05-18T19:52:44.000Z (about 1 month ago)
- Last Synced: 2026-05-18T21:56:49.453Z (about 1 month ago)
- Topics: buffered, go, retry
- Language: Go
- Homepage:
- Size: 375 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# retry
[](https://github.com/homeport/retry/blob/main/LICENSE)
[](https://goreportcard.com/report/github.com/homeport/retry)
[](https://github.com/homeport/retry/actions?query=workflow%3A%22Tests%22)
[](https://codecov.io/gh/homeport/retry)
[](https://pkg.go.dev/github.com/homeport/retry)
[](https://github.com/homeport/retry/releases/latest)
Tool to retry a command in case it fails. Prepend `retry` to your command and it will retry the command in case of an exit code other than zero.
Please note, in case data is piped into the tool, `retry` will read and buffer any data from standard input and reuse it with every other attempt.

## Installation
### Homebrew
The `homeport/tap` has macOS and GNU/Linux pre-built binaries available:
```bash
brew install homeport/tap/retry
```
### Pre-built binaries in GitHub
Prebuilt binaries can be [downloaded from the GitHub Releases section](https://github.com/homeport/retry/releases/latest).
### Curl To Shell Convenience Script
There is a convenience script to download the latest release for Linux or macOS if you want to need it simple (you need `curl` and `jq` installed on your machine):
```bash
curl --silent --location https://raw.githubusercontent.com/homeport/retry/main/hack/download.sh | bash
```
## Contributing
We are happy to have other people contributing to the project. If you decide to do that, here's how to:
- get Go (`retry` requires Go version 1.20 or greater)
- fork the project
- create a new branch
- make your changes
- open a PR.
Git commit messages should be meaningful and follow the rules nicely written down by [Chris Beams](https://chris.beams.io/posts/git-commit/):
> The seven rules of a great Git commit message
>
> 1. Separate subject from body with a blank line
> 1. Limit the subject line to 50 characters
> 1. Capitalize the subject line
> 1. Do not end the subject line with a period
> 1. Use the imperative mood in the subject line
> 1. Wrap the body at 72 characters
> 1. Use the body to explain what and why vs. how
### Running test cases and binaries generation
Run test cases:
```bash
ginkgo run ./...
```
Create binaries:
```bash
goreleaser build --rm-dist --snapshot
```
## License
Licensed under [MIT License](https://github.com/homeport/retry/blob/main/LICENSE)