diff options
| author | Mag Mell <sakiiily@aosc.io> | 2024-01-26 17:45:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-26 09:45:42 +0000 |
| commit | d21de3cd252d80bf54a6d0b175122048b8af85fd (patch) | |
| tree | eae5aa9d0bef0f1ba7a335860e015201d608c264 /atuin-client/src/api_client.rs | |
| parent | fix: Check for format errors when printing history (#1623) (diff) | |
| download | atuin-d21de3cd252d80bf54a6d0b175122048b8af85fd.zip | |
chore: add feature to allow always disable check update (#1628)
* chore: add feature to allow always disable check update
In the packaging rules of some distributions, the software's self-update check needs to be permanently turned off
This commit will make it easier for these users to
* fix: formatting
---------
Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
Diffstat (limited to 'atuin-client/src/api_client.rs')
| -rw-r--r-- | atuin-client/src/api_client.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/atuin-client/src/api_client.rs b/atuin-client/src/api_client.rs index affb3c98..dc835cfb 100644 --- a/atuin-client/src/api_client.rs +++ b/atuin-client/src/api_client.rs @@ -10,8 +10,8 @@ use reqwest::{ use atuin_common::{ api::{ - AddHistoryRequest, CountResponse, DeleteHistoryRequest, ErrorResponse, IndexResponse, - LoginRequest, LoginResponse, RegisterResponse, StatusResponse, SyncHistoryResponse, + AddHistoryRequest, CountResponse, DeleteHistoryRequest, ErrorResponse, LoginRequest, + LoginResponse, RegisterResponse, StatusResponse, SyncHistoryResponse, }, record::RecordStatus, }; @@ -19,6 +19,7 @@ use atuin_common::{ api::{ATUIN_CARGO_VERSION, ATUIN_HEADER_VERSION, ATUIN_VERSION}, record::{EncryptedData, HostId, Record, RecordIdx}, }; + use semver::Version; use time::format_description::well_known::Rfc3339; use time::OffsetDateTime; @@ -97,7 +98,10 @@ pub async fn login(address: &str, req: LoginRequest) -> Result<LoginResponse> { Ok(session) } +#[cfg(feature = "check-update")] pub async fn latest_version() -> Result<Version> { + use atuin_common::api::IndexResponse; + let url = "https://api.atuin.sh"; let client = reqwest::Client::new(); |
