Skip to content

Commit 4968ef3

Browse files
committed
fix tty check
1 parent ea16110 commit 4968ef3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/update.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ export function checkForUpdate(): void {
4646

4747
try {
4848
if (IS_NPX) return;
49-
if (!process.stderr.isTTY) return;
5049

5150
const notifier = updateNotifier({
5251
pkg: { name: PACKAGE_NAME, version: PACKAGE_VERSION },
5352
updateCheckInterval: ONE_DAY_MS,
5453
});
5554

55+
// Always run check() so the background process is spawned and the cache
56+
// stays fresh, even when stderr is not a TTY. Only gate the display.
5657
notifier.check();
5758

59+
if (!process.stderr.isTTY) return;
5860
if (!notifier.update) return;
5961
if (!semverGt(notifier.update.latest, PACKAGE_VERSION)) return;
6062

0 commit comments

Comments
 (0)