Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top