From 8c6c9f3f3f9040c8c45fe6f0c0623afe615e4a56 Mon Sep 17 00:00:00 2001 From: HellSquirrel Date: Wed, 12 Jun 2019 21:58:00 +0300 Subject: [PATCH] Add CI check & pretify file --- .npm/postinstall.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.npm/postinstall.js b/.npm/postinstall.js index c90a20f2..bce4066c 100644 --- a/.npm/postinstall.js +++ b/.npm/postinstall.js @@ -1,10 +1,13 @@ -require('process'); -const { spawn } = require('child_process'); +require("process"); +const { spawn } = require("child_process"); -process.chdir(process.env.INIT_CWD); +const isCI = process.env.$CI; +if (!isCI) { + process.chdir(process.env.INIT_CWD); -result = spawn('npx', ['lefthook', 'install']); + result = spawn("npx", ["lefthook", "install"]); -result.stdout.on('data', (data) => { + result.stdout.on("data", data => { console.log(`${data}`); -}); + }); +}