diff options
author | Ellie Huxtable <ellie@elliehuxtable.com> | 2022-10-12 22:47:57 +0100 |
---|---|---|
committer | Ellie Huxtable <ellie@elliehuxtable.com> | 2022-10-12 22:47:57 +0100 |
commit | 621feb17a6ced5eb220dd768cd5ccafb091da0c3 (patch) | |
tree | 71b97666a3a50402b2dad6c3c91478c7c95a7b0e | |
parent | c41f9d5578a837eaa20da073db6f6ba79cb46626 (diff) |
Add setting to opt out of update checks
-rw-r--r-- | atuin-client/src/settings.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index 7e84e1e3..10a54fe6 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -92,6 +92,7 @@ pub struct Settings { pub dialect: Dialect, pub style: Style, pub auto_sync: bool, + pub update_check: bool, pub sync_address: String, pub sync_frequency: String, pub db_path: String, @@ -219,6 +220,10 @@ impl Settings { // Return Some(latest version) if an update is needed. Otherwise, none. pub async fn needs_update(&self) -> Option<Version> { + if !self.update_check { + return None; + } + let current = Version::parse(env!("CARGO_PKG_VERSION")).unwrap_or(Version::new(100000, 0, 0)); @@ -267,6 +272,7 @@ impl Settings { .set_default("session_path", session_path.to_str())? .set_default("dialect", "us")? .set_default("auto_sync", true)? + .set_default("update_check", true)? .set_default("sync_frequency", "1h")? .set_default("sync_address", "https://api.atuin.sh")? .set_default("search_mode", "prefix")? |