self_update
provides updaters for updating rust executables in-place from various release
distribution backends.
Currently only GitHub releases are supported.
shell
self_update = "0.1"
Update (replace) the current executable with the latest release downloaded
from https://api.github.com/repos/jaemk/self_update/releases/latest
```rust
fn update() -> Result<(), Box<::std::error::Error>> {
let target = selfupdate::gettarget()?;
let status = selfupdate::backends::github::Updater::configure()?
.repoowner("jaemk")
.reponame("selfupdate")
.target(&target)
.binname("selfupdateexample")
.showdownloadprogress(true)
.currentversion(cargocrateversion!())
.build()?
.update()?;
println!("Update status: v{}
!", status.version());
Ok(())
}
```
Run the above example to see self_update
in action: cargo run --example github
License: MIT