mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
25 lines
673 B
Rust
25 lines
673 B
Rust
use anyhow::Result;
|
|
use clap::Parser;
|
|
use self_update::cargo_crate_version;
|
|
|
|
#[derive(Parser)]
|
|
pub(super) struct Opts {
|
|
/// Do not ask before processing the self-update
|
|
#[clap(long, conflicts_with = "dry_run")]
|
|
force: bool,
|
|
}
|
|
|
|
pub(super) fn execute(opts: Opts) -> Result<()> {
|
|
let status = self_update::backends::github::Update::configure()
|
|
.repo_owner("rustic-rs")
|
|
.repo_name("rustic")
|
|
.bin_name("rustic")
|
|
.show_download_progress(true)
|
|
.current_version(cargo_crate_version!())
|
|
.no_confirm(opts.force)
|
|
.build()?
|
|
.update()?;
|
|
println!("Update status: `{}`!", status.version());
|
|
Ok(())
|
|
}
|