Files
MikrotikManager/.ci/scripts/ensure-git-hooks.mjs
T
Denozordec e7a8ad0910
Docker images / prepare-release (push) Successful in 5s
Docker images / backend-image (push) Successful in 2m36s
Docker images / frontend-image (push) Successful in 2m25s
Docker images / updater-image (push) Successful in 37s
Docker images / notify-webhook (push) Has been skipped
Docker images / publish-release (push) Successful in 6s
chore(rules): добавить локальный hook для проверки сообщений коммитов
2026-05-12 18:18:30 +07:00

22 lines
546 B
JavaScript

#!/usr/bin/env node
import { execFileSync, spawnSync } from "node:child_process"
import path from "node:path"
import { fileURLToPath } from "node:url"
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..")
const gitCheck = spawnSync("git", ["rev-parse", "--show-toplevel"], {
cwd: repoRoot,
encoding: "utf8",
})
if (gitCheck.status !== 0) {
process.exit(0)
}
const topLevel = gitCheck.stdout.trim()
execFileSync("git", ["config", "core.hooksPath", ".githooks"], {
cwd: topLevel,
stdio: "ignore",
})