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}`); +});