Tiny update notifier utility for rust cli programs
Checks for update on program launch if more than 24h have passed since the last check, then pops up a notification if a new version was found 📢
Install tinyupdatenotifier using Cargo
bash
cd my-project
cargo add tiny_update_notifier
rust
tiny_update_notifier::Notifier::new().run(pkg_version, pkg_name, pkg_repo_url)
```rust // Spawns a thread to check for updates and notify user if there is a new version available. use tinyupdatenotifier::run_notifier;
fn main() { runnotifier( env!("CARGOPKGVERSION"), env!("CARGOPKGNAME"), env!("CARGOPKG_REPOSITORY"), ); } ```
```rust // equivalent to the code above use std::thread; use tinyupdatenotifier::Notifier;
fn main() { thread::spawn(|| { Notifier::new( env!("CARGOPKGVERSION"), env!("CARGOPKGNAME"), env!("CARGOPKGREPOSITORY"), ) .run(); }); }
Used by https://github.com/Araxeus/ls-interactive/