Skip to content

Commit

Permalink
add postinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
A.A.Abroskin committed Jun 11, 2019
1 parent 02ba5d8 commit 7720b7f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@arkweid/lefthook",
"version": "0.3.3",
"version": "0.3.4",
"description": "Simple git hooks manager",
"main": "index.js",
"bin": {
Expand All @@ -22,5 +22,8 @@
"darwin",
"linux",
"win32"
]
],
"scripts": {
"postinstall": "node postinstall.js"
}
}
10 changes: 10 additions & 0 deletions .npm/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require('process');
const { spawn } = require('child_process');

process.chdir(process.env.INIT_CWD);

result = spawn('npx', ['lefthook', 'install']);

result.stdout.on('data', (data) => {
console.log(`${data}`);
});

0 comments on commit 7720b7f

Please sign in to comment.