feat: improve CLI update check with caching (#1549)

This commit is contained in:
Ralph Khreish
2025-12-26 22:31:17 +01:00
committed by GitHub
parent 6c03e694c6
commit 98087acae9
4 changed files with 187 additions and 69 deletions

View File

@@ -5402,9 +5402,16 @@ async function runCLI(argv = process.argv) {
displayBanner();
}
// Check for updates BEFORE executing the command
// Check for updates BEFORE executing the command (skip entirely in test/CI mode)
const skipAutoUpdate =
process.env.TASKMASTER_SKIP_AUTO_UPDATE === '1' ||
process.env.CI ||
process.env.NODE_ENV === 'test';
const currentVersion = getTaskMasterVersion();
const updateInfo = await checkForUpdate(currentVersion);
const updateInfo = skipAutoUpdate
? { currentVersion, latestVersion: currentVersion, needsUpdate: false }
: await checkForUpdate(currentVersion);
if (updateInfo.needsUpdate) {
// Display the upgrade notification first