feat: Add auto update functionality (#4686)

This commit is contained in:
Gal Zahavi
2025-07-28 17:56:52 -07:00
committed by GitHub
parent 83c4dddb7e
commit 871e0dfab8
12 changed files with 1023 additions and 20 deletions

View File

@@ -40,6 +40,8 @@ import {
import { validateAuthMethod } from './config/auth.js';
import { setMaxSizedBoxDebugging } from './ui/components/shared/MaxSizedBox.js';
import { validateNonInteractiveAuth } from './validateNonInterActiveAuth.js';
import { checkForUpdates } from './ui/utils/updateCheck.js';
import { handleAutoUpdate } from './utils/handleAutoUpdate.js';
import { appEvents, AppEvent } from './utils/events.js';
function getNodeMemoryArgs(config: Config): string[] {
@@ -246,6 +248,17 @@ export async function main() {
{ exitOnCtrlC: false },
);
checkForUpdates()
.then((info) => {
handleAutoUpdate(info, settings, config.getProjectRoot());
})
.catch((err) => {
// Silently ignore update check errors.
if (config.getDebugMode()) {
console.error('Update check failed:', err);
}
});
registerCleanup(() => instance.unmount());
return;
}