From 21bc34286fe69a3212b24516b1475a5e41956eed Mon Sep 17 00:00:00 2001 From: typicode Date: Sun, 8 May 2022 22:47:53 +0200 Subject: [PATCH] feat: skip install if $HUSKY=0 --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.ts b/src/index.ts index 12cb97db4..4877022da 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,6 +10,11 @@ const git = (args: string[]): cp.SpawnSyncReturns => cp.spawnSync('git', args, { stdio: 'inherit' }) export function install(dir = '.husky'): void { + if (process.env.HUSKY === '0') { + l('HUSKY env variable is set to 0, skipping install') + return + } + // Ensure that we're inside a git repository // If git command is not found, status is null and we should return. // That's why status value needs to be checked explicitly.