We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11191bc commit c24b418Copy full SHA for c24b418
scripts/verifyCommit.mjs
@@ -1,10 +1,12 @@
1
// Invoked on the commit-msg git hook by simple-git-hooks.
2
3
import chalk from 'chalk'
4
+import { execSync } from 'node:child_process'
5
import { readFileSync } from 'node:fs'
6
import path from 'node:path'
7
-const msgPath = path.resolve('.git/COMMIT_EDITMSG')
8
+const gitDir = execSync('git rev-parse --git-dir', { encoding: 'utf-8' }).trim()
9
+const msgPath = path.resolve(gitDir, 'COMMIT_EDITMSG')
10
const msg = readFileSync(msgPath, 'utf-8').trim()
11
12
const commitRE =
0 commit comments