Skip to content

Commit eb9b374

Browse files
authored
workflow: switch to simple-git-hooks (#6219)
1 parent 1f03211 commit eb9b374

3 files changed

Lines changed: 17 additions & 114 deletions

File tree

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
"rimraf": "^3.0.2",
5353
"rollup": "^2.59.0",
5454
"semver": "^7.3.5",
55+
"simple-git-hooks": "^2.7.0",
5556
"sirv": "^2.0.0",
5657
"ts-jest": "^27.1.2",
5758
"ts-node": "^10.4.0",
5859
"typescript": "~4.5.4",
5960
"vite": "workspace:*",
60-
"vitepress": "^0.20.10",
61-
"yorkie": "^2.0.0"
61+
"vitepress": "^0.20.10"
6262
},
63-
"gitHooks": {
64-
"pre-commit": "lint-staged --concurrent false",
65-
"commit-msg": "ts-node scripts/verifyCommit.ts"
63+
"simple-git-hooks": {
64+
"pre-commit": "pnpm exec lint-staged --concurrent false",
65+
"commit-msg": "pnpm exec ts-node scripts/verifyCommit.ts $1"
6666
},
6767
"lint-staged": {
6868
"*": [

pnpm-lock.yaml

Lines changed: 9 additions & 107 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/verifyCommit.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// Invoked on the commit-msg git hook by yorkie.
1+
// Invoked on the commit-msg git hook by simple-git-hooks.
22

33
import colors from 'picocolors'
44
import { readFileSync } from 'fs'
55

6-
const msgPath = process.env.GIT_PARAMS!
6+
// get $1 from commit-msg script
7+
const msgPath = process.argv[2]
78
const msg = readFileSync(msgPath, 'utf-8').trim()
89

910
const releaseRE = /^v\d/

0 commit comments

Comments
 (0)