mirror of
https://github.com/google-gemini/gemini-cli
synced 2026-04-21 13:37:17 +00:00
fix(shell): remove trailing semicolons to strictly adhere to newline-based wrapping
This commit is contained in:
parent
c0d3fdc4c7
commit
9dff2e0299
4 changed files with 5 additions and 5 deletions
|
|
@ -256,7 +256,7 @@ describe('useExecutionLifecycle', () => {
|
|||
});
|
||||
const tmpFile = path.join('/tmp/gemini-shell-abcdef', 'pwd.tmp');
|
||||
const escapedTmpFile = escapeShellArg(tmpFile, 'bash');
|
||||
const wrappedCommand = `{\nls -l\n}; __code=$?; pwd > ${escapedTmpFile}; exit $__code`;
|
||||
const wrappedCommand = `{\nls -l\n}\n__code=$?; pwd > ${escapedTmpFile}; exit $__code`;
|
||||
expect(mockShellExecutionService).toHaveBeenCalledWith(
|
||||
wrappedCommand,
|
||||
'/test/dir',
|
||||
|
|
@ -367,7 +367,7 @@ describe('useExecutionLifecycle', () => {
|
|||
|
||||
const tmpFile = path.join('/tmp/gemini-shell-abcdef', 'pwd.tmp');
|
||||
const escapedTmpFile = escapeShellArg(tmpFile, 'bash');
|
||||
const wrappedCommand = `{\nstream\n}; __code=$?; pwd > ${escapedTmpFile}; exit $__code`;
|
||||
const wrappedCommand = `{\nstream\n}\n__code=$?; pwd > ${escapedTmpFile}; exit $__code`;
|
||||
expect(mockShellExecutionService).toHaveBeenCalledWith(
|
||||
wrappedCommand,
|
||||
'/test/dir',
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ export const useExecutionLifecycle = (
|
|||
);
|
||||
pwdFilePath = path.join(tmpDir, 'pwd.tmp');
|
||||
const escapedPwdFilePath = escapeShellArg(pwdFilePath, 'bash');
|
||||
commandToExecute = `{\n${command}\n}; __code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
||||
commandToExecute = `{\n${command}\n}\n__code=$?; pwd > ${escapedPwdFilePath}; exit $__code`;
|
||||
}
|
||||
|
||||
onDebugMessage(`Executing in ${targetDir}: ${commandToExecute}`);
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ EOF`;
|
|||
false,
|
||||
expect.any(Object),
|
||||
);
|
||||
expect(mockShellExecutionService.mock.calls[0][0]).toMatch(/\nEOF\n\);/);
|
||||
expect(mockShellExecutionService.mock.calls[0][0]).toMatch(/\nEOF\n\)\n/);
|
||||
});
|
||||
|
||||
it('should format error messages correctly', async () => {
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
|||
trimmed += ' ';
|
||||
}
|
||||
const escapedTempFilePath = escapeShellArg(tempFilePath, 'bash');
|
||||
return `(\n${trimmed}\n); __code=$?; pgrep -g 0 >${escapedTempFilePath} 2>&1; exit $__code;`;
|
||||
return `(\n${trimmed}\n)\n__code=$?; pgrep -g 0 >${escapedTempFilePath} 2>&1; exit $__code;`;
|
||||
}
|
||||
|
||||
private getContextualDetails(): string {
|
||||
|
|
|
|||
Loading…
Reference in a new issue