Skip to content

Commit

Permalink
feat: skip install if $HUSKY=0
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode authored and nikoladavitkovski committed Sep 5, 2022
1 parent 69afc14 commit 99169cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const git = (args: string[]): cp.SpawnSyncReturns<Buffer> =>
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.
Expand Down

0 comments on commit 99169cb

Please sign in to comment.