mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
fix(upgrade): put prompt date in the past when creating a file (#16380)
This commit is contained in:
parent
d461a784b2
commit
0e1a71fec6
1 changed files with 4 additions and 1 deletions
|
@ -15,6 +15,7 @@ use once_cell::sync::Lazy;
|
|||
use std::env;
|
||||
use std::fs;
|
||||
use std::io::Write;
|
||||
use std::ops::Sub;
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
use std::process::Command;
|
||||
|
@ -75,7 +76,9 @@ pub fn check_for_upgrades(cache_dir: PathBuf) {
|
|||
};
|
||||
|
||||
let file = CheckVersionFile {
|
||||
last_prompt: chrono::Utc::now(),
|
||||
// put a date in the past here so that prompt can be shown on next run
|
||||
last_prompt: chrono::Utc::now()
|
||||
.sub(chrono::Duration::hours(UPGRADE_CHECK_INTERVAL + 1)),
|
||||
last_checked: chrono::Utc::now(),
|
||||
latest_version,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue