fix: re-add updates check caching

This commit is contained in:
daimond113 2024-11-19 00:32:08 +01:00
parent 4866559025
commit d52a9cb615
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C
2 changed files with 19 additions and 2 deletions

View file

@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Add back mistakenly removed updates check caching by @daimond113
## [0.5.0-rc.10] - 2024-11-16
### Fixed
- Fix `self-install` doing a cross-device move by @daimond113

View file

@ -1,4 +1,9 @@
use crate::cli::{bin_dir, config::read_config, files::make_executable, home_dir};
use crate::cli::{
bin_dir,
config::{read_config, write_config, CliConfig},
files::make_executable,
home_dir,
};
use anyhow::Context;
use colored::Colorize;
use fs_err::tokio as fs;
@ -70,7 +75,15 @@ pub async fn check_for_updates(reqwest: &reqwest::Client) -> anyhow::Result<()>
{
version
} else {
get_latest_remote_version(reqwest).await?
let version = get_latest_remote_version(reqwest).await?;
write_config(&CliConfig {
last_checked_updates: Some((chrono::Utc::now(), version.clone())),
..config
})
.await?;
version
};
let current_version = current_version();