binswap-github
Download and swap binaries from GitHub
Usage
binswap uses the same infrastructure as
cargo-binstall to
determine where the latest binaries are stored. binswap-github is the
backend to do this for GitHub specifically. It uses the GitHub releases to
download binaries for a supported target, and then downloads them to a
specified location, or optionally swaps them with the currently executed
binary.
This is particularly useful if you distribute binaries outside of package managers or in environments where the users are not expected to have Rust nor installed. With crate, you can bundle the updating mechanism into the distributed binary.
Example
The following example downloads the latest release ripgrep from
GitHub, and swaps it with
the currently executed binary. .dry_run(true) is added here to simulate
the execution, but not perform the update.
async
The following does the same, but just writes the resulting binary to a new file.
async
License
Licensed under either of
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.