Skip to content

Commit 21bc342

Browse files
committedMay 8, 2022
feat: skip install if $HUSKY=0
1 parent e9351c0 commit 21bc342

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ const git = (args: string[]): cp.SpawnSyncReturns<Buffer> =>
1010
cp.spawnSync('git', args, { stdio: 'inherit' })
1111

1212
export function install(dir = '.husky'): void {
13+
if (process.env.HUSKY === '0') {
14+
l('HUSKY env variable is set to 0, skipping install')
15+
return
16+
}
17+
1318
// Ensure that we're inside a git repository
1419
// If git command is not found, status is null and we should return.
1520
// That's why status value needs to be checked explicitly.

0 commit comments

Comments
 (0)
Please sign in to comment.