Question

I have a project with a package.json to load all the dev dependencies. Is there a way to install git commit hooks when after installing the project with npm install?

Was it helpful?

Solution

Considering the npm project, npm install itself will only install/clone the git repos, but also interpret the script section.

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

You could declare a script in the install or postinstall step which would add your hooks in the cloned repos.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top