我的.husky
放置在父目录。在孩子身上,我有nx workspace
代码。在这种情况下,我如何添加引用链接来检查父目录中的脚本?
parent/
├─ nx-workspace/
│ ├─ package.json
│ ├─ apps
│ ├─ libs
.git
.husky
这里是包。Json脚本应该读取git和husky的细节。
在pre-commit
钩子中,我们可以通过
git rev-parse --absolute-git-dir
如果我们知道文件夹的结构,就很容易得到其他目录的路径。