From 7720b7f078f204b775326d581f31f5fa4ecd2968 Mon Sep 17 00:00:00 2001 From: "A.A.Abroskin" Date: Tue, 11 Jun 2019 12:41:04 +0300 Subject: [PATCH] add postinstall --- .npm/package.json | 7 +++++-- .npm/postinstall.js | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .npm/postinstall.js diff --git a/.npm/package.json b/.npm/package.json index 51f143dd..419a8b19 100644 --- a/.npm/package.json +++ b/.npm/package.json @@ -1,6 +1,6 @@ { "name": "@arkweid/lefthook", - "version": "0.3.3", + "version": "0.3.4", "description": "Simple git hooks manager", "main": "index.js", "bin": { @@ -22,5 +22,8 @@ "darwin", "linux", "win32" - ] + ], + "scripts": { + "postinstall": "node postinstall.js" + } } diff --git a/.npm/postinstall.js b/.npm/postinstall.js new file mode 100644 index 00000000..c90a20f2 --- /dev/null +++ b/.npm/postinstall.js @@ -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}`); +});