mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-29 13:13:21 -07:00
repro: normalize hook names and use JSON for blocking test
This commit is contained in:
@@ -101,8 +101,11 @@ describe('Hooks System Integration', () => {
|
||||
const scriptPath = rig.createScript(
|
||||
'stderr_block_hook.cjs',
|
||||
`
|
||||
process.stderr.write('File writing blocked by security policy');
|
||||
process.exit(2);
|
||||
console.log(JSON.stringify({
|
||||
decision: 'deny',
|
||||
reason: 'File writing blocked by security policy'
|
||||
}));
|
||||
process.exit(0);
|
||||
`,
|
||||
);
|
||||
|
||||
|
||||
@@ -93,7 +93,8 @@ export class HookRegistry {
|
||||
private getHookName(
|
||||
entry: HookRegistryEntry | { config: HookConfig },
|
||||
): string {
|
||||
return entry.config.name || entry.config.command || 'unknown-command';
|
||||
const name = entry.config.name || entry.config.command || 'unknown-command';
|
||||
return name.replace(/\\/g, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user