Add pre-commit verification hook

This commit is contained in:
Federico Jaramillo Martinez
2026-05-11 11:14:48 +02:00
parent c82486a2e5
commit 020b8f00ca
6 changed files with 55 additions and 22 deletions
+14
View File
@@ -0,0 +1,14 @@
import { existsSync } from 'node:fs';
import { execFileSync } from 'node:child_process';
if (!existsSync('.git')) {
process.exit(0);
}
try {
execFileSync('git', ['config', 'core.hooksPath', '.githooks'], { stdio: 'inherit' });
console.log('Configured git hooks path: .githooks');
} catch (error) {
console.warn('Could not configure git hooks path. Run: git config core.hooksPath .githooks');
process.exitCode = 0;
}