Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/float.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down
1 change: 1 addition & 0 deletions src/lib/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const defaultArgs: Args = {
password: "",
token: "",
headless: false,
updateCheck: true,
plexUsername: "",
plexPassword: "",
sanityCheck: false,
Expand Down
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type Args = {
password: string;
token: string;
headless: boolean;
updateCheck: boolean;
plexUsername: string;
plexPassword: string;
sanityCheck: boolean;
Expand Down
Loading