All checks were successful
Build, test and publish / verify (push) Successful in 1m40s
14 lines
473 B
JavaScript
14 lines
473 B
JavaScript
import { existsSync } from 'node:fs';
|
|
import { fileURLToPath } from 'node:url';
|
|
import husky from 'husky';
|
|
|
|
// Docker uses CI=true; CI and local opt-out must never change Git configuration.
|
|
if (!process.env.CI && process.env.HUSKY !== '0') {
|
|
const root = fileURLToPath(new URL('../../', import.meta.url));
|
|
if (existsSync(new URL('../../.git', import.meta.url))) {
|
|
process.chdir(root);
|
|
const error = husky('.husky');
|
|
if (error) throw new Error(error);
|
|
}
|
|
}
|