【问题标题】:Install git hook until npm install安装 git hook 直到 npm install
【发布时间】:2012-12-30 01:17:17
【问题描述】:

我有一个带有package.json 的项目来加载所有开发依赖项。用npm install安装项目后有没有办法安装git commit hooks?

【问题讨论】:

    标签: git npm pre-commit-hook


    【解决方案1】:

    考虑到npm projectnpm install 本身只会安装/克隆 git repos,还会解释 script section

    { "scripts" :
      { "install" : "scripts/install.js"
      , "postinstall" : "scripts/install.js"
      , "uninstall" : "scripts/uninstall.js"
      }
    }
    

    您可以在installpostinstall 步骤中声明一个脚本,该脚本会将您的挂钩添加到克隆的存储库中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-02
      • 1970-01-01
      • 2016-04-14
      • 2022-01-05
      • 2014-10-08
      • 1970-01-01
      • 2014-07-19
      • 2018-03-01
      相关资源
      最近更新 更多