Skip to content

Commit 761b7bc

Browse files
authored
Merge pull request #56 from muxinc/dj/update-available
feat: add update notifier to check for newer CLI versions
2 parents 1c58dbd + e7df2d1 commit 761b7bc

File tree

5 files changed

+671
-2
lines changed

5 files changed

+671
-2
lines changed

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { transcriptionVocabulariesCommand } from './commands/transcription-vocab
2424
import { uploadsCommand } from './commands/uploads/index.ts';
2525
import { videoViewsCommand } from './commands/video-views/index.ts';
2626
import { setAgentMode } from './lib/context.ts';
27+
import { checkForUpdate } from './lib/update-notifier.ts';
2728

2829
const VERSION = pkg.version;
2930

@@ -85,6 +86,8 @@ const cli = new Command()
8586

8687
// Run the CLI
8788
if (import.meta.main) {
89+
const updateCheck = checkForUpdate(VERSION).catch(() => null);
90+
8891
try {
8992
await cli.parse(preprocessArgs(Bun.argv.slice(2)));
9093
} catch (error) {
@@ -95,6 +98,9 @@ if (import.meta.main) {
9598
}
9699
process.exit(1);
97100
}
101+
102+
const notice = await updateCheck;
103+
if (notice) console.error(notice);
98104
}
99105

100106
export { cli };

0 commit comments

Comments
 (0)