Skip to main content

check_for_updates_auto

Function check_for_updates_auto 

Source
pub async fn check_for_updates_auto(
    bin_name: &str,
    current_version: &str,
) -> Result<UpdateStatus>
Expand description

Check for updates automatically using self_update backend

This is a simplified function that leverages self_update’s GitHub backend to check for available updates without installing them.

§Arguments

  • bin_name - Name of the binary (e.g., “terraphim”)
  • current_version - Current version of the binary (e.g., “1.0.0”)

§Returns

  • Ok(UpdateStatus) - Status indicating if an update is available
  • Err(anyhow::Error) - Error if the check fails

§Example

use terraphim_update::check_for_updates_auto;

async {
    let status = check_for_updates_auto("terraphim", "1.0.0").await?;
    println!("Update status: {}", status);
    Ok::<(), anyhow::Error>(())
};