This repository has been archived on 2026-08-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
pi-web/scripts/install-git-hooks.mjs

15 lines
428 B
JavaScript

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;
}