Files
oh-my-claudecode/scripts/setup-maintenance.mjs
Yeachan-Heo fb6828562c fix(hooks): improve Windows compatibility for hook scripts (#524)
Use pathToFileURL for dynamic imports instead of raw file paths, which
fixes "hook error" on Windows where backslash paths break ESM imports.
Add suppressOutput: true to empty hook responses to mitigate the known
Claude Code "hook error" display bug (#10936).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:36:22 +00:00

22 lines
672 B
JavaScript
Executable File

#!/usr/bin/env node
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
import { readStdin } from './lib/stdin.mjs';
async function main() {
// Read stdin (timeout-protected, see issue #240/#459)
const input = await readStdin();
try {
const data = JSON.parse(input);
const { processSetupMaintenance } = await import('../dist/hooks/setup/index.js');
const result = await processSetupMaintenance(data);
console.log(JSON.stringify(result));
} catch (error) {
console.error('[setup-maintenance] Error:', error.message);
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
}
}
main();