You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if self_update incorporates an update check policy that works across platforms, where you can set a time interval between checks, so the next time the binary is run and the interval has passed, it will invoke the update automatically.
The text was updated successfully, but these errors were encountered:
Seems like a good idea. Maybe implemented as some struct that you pass a file path to where it can look for and save the last timestamp at which it checked, and then run a lambda against that timestamp? Some like
let f = xdg_dirs.place_config_file("last_update.stamp")?;let g = UpdateGuard::new(f, |ts| {(now() - chrono::DateTime::parse_from_rfc3339(s)?) > Duration::from_secs(60*60*24*7)})?;if g.should_try()? {
...g.save_attempt();}
Great! Perhaps you can have a default of using the bin name to save the last_update.stamp file in a hidden directory (e.g. ".foo" for program ""foo").
Perhaps, there can even be a way for users to optionally specify their update preferences similar to how cargo.toml checks for semver (say "selfupdate.toml" in the same hidden directory) - so folks can pin to a specific version, or only allow patch updates.
It would be nice if self_update incorporates an update check policy that works across platforms, where you can set a time interval between checks, so the next time the binary is run and the interval has passed, it will invoke the update automatically.
The text was updated successfully, but these errors were encountered: