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 committed May 8, 2022
1 parent e9351c0 commit 21bc342
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
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 21bc342

Please sign in to comment.