Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-git-hooks

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-git-hooks - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

14

install-git-hooks.js

@@ -10,5 +10,11 @@ const fs = require("fs");

let repoPath = "./";
let gitHooksPath = "./.githooks";
if (package["node-git-hooks"] && package["node-git-hooks"]["repo-path"]) {
repoPath = package["node-git-hooks"]["repo-path"];
if (package["node-git-hooks"]) {
if (package["node-git-hooks"]["repo-path"]) {
repoPath = package["node-git-hooks"]["repo-path"];
}
if (package["node-git-hooks"]["githooks-path"]) {
gitHooksPath = package["node-git-hooks"]["githooks-path"];
}
}

@@ -21,3 +27,3 @@

if (!fs.existsSync("./.githooks")) {
if (!fs.existsSync(gitHooksPath)) {
console.log("No .githooks folder found. Skipping hooks installation.");

@@ -29,3 +35,3 @@ return 0;

try {
copyDir("./.githooks", `${repoPath}.git/hooks`);
copyDir(gitHooksPath, `${repoPath}.git/hooks`);
} catch (error) {

@@ -32,0 +38,0 @@ console.error("Error copying Git hooks: ", error);

{
"name": "node-git-hooks",
"version": "1.0.6",
"version": "1.0.7",
"description": "Automate git hook deployment",

@@ -5,0 +5,0 @@ "main": "install-git-hook.js",

@@ -36,6 +36,6 @@ # Cross-Platform Installation of Git Hooks

Add the following `postinstall` script to package.json:
Add the following `prepare` script to package.json:
```
"scripts": {
"postinstall": "node-git-hooks"
"prepare": "node-git-hooks"
},

@@ -57,1 +57,10 @@ ```

```
It is also possible to set the githooks folder path following the same logic:
```
{
"node-git-hooks": {
"githooks-path": "../"
}
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc