fix: current version not updated in update check (#1482)
This commit is contained in:
+1
-1
@@ -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";
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user