We're having a growing number of packages in this repository. This PR moves them into a `packages/` directory like it's commonly done in other projects.
22 lines
606 B
TypeScript
22 lines
606 B
TypeScript
import { DAY } from "../../src/constants.ts";
|
|
import { updateCheck } from "../../src/dev/update_check.ts";
|
|
|
|
// deno-lint-ignore require-await
|
|
async function getLatestVersion() {
|
|
// deno-lint-ignore no-console
|
|
console.log("fetching latest version");
|
|
return Deno.env.get("LATEST_VERSION") ?? "99.99.999";
|
|
}
|
|
|
|
function getCurrentVersion() {
|
|
return Deno.env.get("CURRENT_VERSION")!;
|
|
}
|
|
|
|
const interval = +(Deno.env.get("UPDATE_INTERVAL") ?? DAY);
|
|
await updateCheck(
|
|
interval,
|
|
() => Deno.env.get("TEST_HOME")!,
|
|
getLatestVersion,
|
|
Deno.env.has("CURRENT_VERSION") ? getCurrentVersion : undefined,
|
|
);
|