Archived
Add pre-commit verification hook
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user