mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 06:54:15 -07:00
Code review fix.
This commit is contained in:
@@ -431,6 +431,9 @@ export const useExecutionLifecycle = (
|
|||||||
|
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case 'raw_data':
|
case 'raw_data':
|
||||||
|
// We rely on 'file_data' for the clean output stream.
|
||||||
|
break;
|
||||||
|
case 'file_data':
|
||||||
if (!isBinaryStream) {
|
if (!isBinaryStream) {
|
||||||
outputStream.write(event.chunk);
|
outputStream.write(event.chunk);
|
||||||
totalBytesWritten += Buffer.byteLength(event.chunk);
|
totalBytesWritten += Buffer.byteLength(event.chunk);
|
||||||
@@ -679,19 +682,15 @@ export const useExecutionLifecycle = (
|
|||||||
if (!outputStream.closed) {
|
if (!outputStream.closed) {
|
||||||
outputStream.destroy();
|
outputStream.destroy();
|
||||||
}
|
}
|
||||||
if (pwdFilePath && fs.existsSync(pwdFilePath)) {
|
if (pwdFilePath) {
|
||||||
fs.unlinkSync(pwdFilePath);
|
fs.promises.unlink(pwdFilePath).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch({ type: 'SET_ACTIVE_PTY', pid: null });
|
dispatch({ type: 'SET_ACTIVE_PTY', pid: null });
|
||||||
setShellInputFocused(false);
|
setShellInputFocused(false);
|
||||||
|
|
||||||
if (!fullOutputReturned && fs.existsSync(outputFilePath)) {
|
if (!fullOutputReturned) {
|
||||||
try {
|
fs.promises.unlink(outputFilePath).catch(() => {});
|
||||||
fs.unlinkSync(outputFilePath);
|
|
||||||
} catch {
|
|
||||||
// Ignore errors during unlink
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user