Skip to content

Commit

Permalink
fix: add parens around the null coalescing operator to fix issues whe…
Browse files Browse the repository at this point in the history
…n npm_config_user_agent exists (#1519)
  • Loading branch information
dexmlee committed Sep 11, 2024
1 parent 3b3e7f1 commit b4465ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ if (a == 'init') {
w(n, JSON.stringify(o, 0, /\t/.test(s) ? '\t' : 2) + '\n')
p.stdout.write(i())
try { f.mkdirSync('.husky') } catch {}
w('.husky/pre-commit', p.env.npm_config_user_agent?.split('/')[0] ?? 'npm' + ' test\n')
w('.husky/pre-commit', (p.env.npm_config_user_agent?.split('/')[0] ?? 'npm') + ' test\n')
p.exit()
}

d = c => console.error(`${c} command is DEPRECATED`)
if (['add', 'set', 'uninstall'].includes(a)) { d(a); p.exit(1) }
if (a == 'install') d(a)

p.stdout.write(i(a == 'install' ? undefined : a))
p.stdout.write(i(a == 'install' ? undefined : a))

0 comments on commit b4465ed

Please sign in to comment.