Skip to main content

interstice_cli/
update.rs

1use interstice_core::IntersticeError;
2
3pub fn update() -> Result<(), IntersticeError> {
4    let status = self_update::backends::github::Update::configure()
5        .repo_owner("Naloween")
6        .repo_name("interstice")
7        .bin_name("interstice")
8        .show_download_progress(true)
9        .current_version(env!("CARGO_PKG_VERSION"))
10        .build()
11        .map_err(|err| IntersticeError::Internal(format!("Update setup failed: {err}")))?
12        .update()
13        .map_err(|err| IntersticeError::Internal(format!("Update failed: {err}")))?;
14
15    println!("Updated to {}", status.version());
16    Ok(())
17}