fix: current version not updated in update check (#1482)

This commit is contained in:
Marvin Hagemeister
2023-07-21 13:02:16 +02:00
committed by GitHub
parent 72603d60cf
commit 3ab35a44f9
3 changed files with 43 additions and 6 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ export {
SEP,
toFileUrl,
} from "https://deno.land/std@0.193.0/path/mod.ts";
export { DAY } from "https://deno.land/std@0.193.0/datetime/constants.ts";
export { DAY, WEEK } from "https://deno.land/std@0.193.0/datetime/constants.ts";
export * as colors from "https://deno.land/std@0.193.0/fmt/colors.ts";
export { walk, WalkError } from "https://deno.land/std@0.193.0/fs/walk.ts";
export { parse } from "https://deno.land/std@0.193.0/flags/mod.ts";
+4 -1
View File
@@ -1,6 +1,6 @@
import { colors, join } from "./deps.ts";
interface CheckFile {
export interface CheckFile {
last_checked: string;
latest_version: string;
current_version: string;
@@ -88,6 +88,9 @@ export async function updateCheck(
}
}
// Update current version
checkFile.current_version = versions[0];
// Only check in the specificed interval
if (Date.now() >= new Date(checkFile.last_checked).getTime() + interval) {
try {