From cde2c86d9c7fc35fbabd50dd3c299ef3ae49c1d0 Mon Sep 17 00:00:00 2001 From: Cobalt Date: Fri, 12 Sep 2025 12:40:50 +0200 Subject: [PATCH] feat: add option to disable update check This adds an arg to toggle the update check. --- src/float.ts | 24 +++++++++++++----------- src/lib/defaults.ts | 1 + src/lib/types.ts | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/float.ts b/src/float.ts index 63338edc..c184afe0 100644 --- a/src/float.ts +++ b/src/float.ts @@ -62,17 +62,19 @@ process.on("SIGTERM", () => process.exit(143)); console.log(chalk`\n{red ///}{grey ===} {cyan Console} {grey ===}{red \\\\\\}`); } - const latest = await fApi - .got("https://raw.githubusercontent.com/Inrixia/Floatplane-Downloader/master/package.json") - .json<{ version: string }>() - .catch(() => ({ version: DownloaderVersion })); - - if (gt(latest.version, DownloaderVersion)) - console.log( - chalk`There is a ${diff(latest.version, DownloaderVersion)} update available! ${DownloaderVersion} > ${ - latest.version - }.\nHead to {cyanBright https://github.com/Inrixia/Floatplane-Downloader/releases} to update!\n`, - ); + if (args.updateCheck) { + const latest = await fApi + .got("https://raw.githubusercontent.com/Inrixia/Floatplane-Downloader/master/package.json") + .json<{ version: string }>() + .catch(() => ({ version: DownloaderVersion })); + + if (gt(latest.version, DownloaderVersion)) + console.log( + chalk`There is a ${diff(latest.version, DownloaderVersion)} update available! ${DownloaderVersion} > ${ + latest.version + }.\nHead to {cyanBright https://github.com/Inrixia/Floatplane-Downloader/releases} to update!\n`, + ); + } if (args.sanityCheck) { console.log("Sanity check passed!"); diff --git a/src/lib/defaults.ts b/src/lib/defaults.ts index bf379562..07d271f7 100644 --- a/src/lib/defaults.ts +++ b/src/lib/defaults.ts @@ -31,6 +31,7 @@ export const defaultArgs: Args = { password: "", token: "", headless: false, + updateCheck: true, plexUsername: "", plexPassword: "", sanityCheck: false, diff --git a/src/lib/types.ts b/src/lib/types.ts index efc75abe..62dfa070 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -30,6 +30,7 @@ export type Args = { password: string; token: string; headless: boolean; + updateCheck: boolean; plexUsername: string; plexPassword: string; sanityCheck: boolean;