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