Skip to content

Commit f2558a7

Browse files
committed
fix: move update notifier after splash screen to prevent notification being cleared
1 parent c9453ee commit f2558a7

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/cli.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,28 @@ import { showSplash } from './utils/splash';
2222
// Read package.json for version
2323
const packageJson = require('../package.json');
2424

25-
// Check for updates
26-
updateNotifier({
27-
pkg: packageJson,
28-
updateCheckInterval: 1000 * 60 * 60 * 24, // Check once per day
29-
}).notify({
30-
isGlobal: true,
31-
defer: false,
32-
});
33-
3425
/**
3526
* Main CLI function
3627
*/
3728
async function main(): Promise<void> {
3829
// Show splash screen animation
3930
await showSplash(packageJson.version);
4031

32+
// Check for updates (after splash to avoid being cleared)
33+
const notifier = updateNotifier({
34+
pkg: packageJson,
35+
updateCheckInterval: 1000 * 60 * 60 * 24, // Check once per day
36+
});
37+
38+
if (notifier.update) {
39+
logger.newline();
40+
notifier.notify({
41+
isGlobal: true,
42+
defer: false,
43+
});
44+
logger.newline();
45+
}
46+
4147
// Create Commander program
4248
const program = new Command();
4349

0 commit comments

Comments
 (0)