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