如何通过Husky在Docker内部运行git-hook命令(例如yarn test
)?
答案 0 :(得分:1)
弄清楚了。该信息进入package.json
:
"husky": {
"hooks": {
"pre-commit": "docker run --rm -v \"$PWD\":/usr/src/app -w /usr/src/app node:alpine yarn test",
"pre-push": "docker run --rm -v \"$PWD\":/usr/src/app -w /usr/src/app node:alpine yarn test"
}
}