【发布时间】:2012-12-30 01:17:17
【问题描述】:
我有一个带有package.json 的项目来加载所有开发依赖项。用npm install安装项目后有没有办法安装git commit hooks?
【问题讨论】:
标签: git npm pre-commit-hook
我有一个带有package.json 的项目来加载所有开发依赖项。用npm install安装项目后有没有办法安装git commit hooks?
【问题讨论】:
标签: git npm pre-commit-hook
考虑到npm project,npm install 本身只会安装/克隆 git repos,还会解释 script section。
{ "scripts" :
{ "install" : "scripts/install.js"
, "postinstall" : "scripts/install.js"
, "uninstall" : "scripts/uninstall.js"
}
}
您可以在install 或postinstall 步骤中声明一个脚本,该脚本会将您的挂钩添加到克隆的存储库中。
【讨论】: