mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-06 03:10:42 -07:00
Fully detach autoupgrade process (#14595)
This commit is contained in:
committed by
GitHub
parent
04cbae5b5f
commit
bdd15e8911
@@ -68,11 +68,13 @@ export function handleAutoUpdate(
|
||||
'@latest',
|
||||
isNightly ? '@nightly' : `@${info.update.latest}`,
|
||||
);
|
||||
const updateProcess = spawnFn(updateCommand, { stdio: 'pipe', shell: true });
|
||||
let errorOutput = '';
|
||||
updateProcess.stderr.on('data', (data) => {
|
||||
errorOutput += data.toString();
|
||||
const updateProcess = spawnFn(updateCommand, {
|
||||
stdio: 'ignore',
|
||||
shell: true,
|
||||
detached: true,
|
||||
});
|
||||
// Un-reference the child process to allow the parent to exit independently.
|
||||
updateProcess.unref();
|
||||
|
||||
updateProcess.on('close', (code) => {
|
||||
if (code === 0) {
|
||||
@@ -82,7 +84,7 @@ export function handleAutoUpdate(
|
||||
});
|
||||
} else {
|
||||
updateEventEmitter.emit('update-failed', {
|
||||
message: `Automatic update failed. Please try updating manually. (command: ${updateCommand}, stderr: ${errorOutput.trim()})`,
|
||||
message: `Automatic update failed. Please try updating manually. (command: ${updateCommand})`,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user