Skip to content

Commit b4465ed

Browse files
authored
fix: add parens around the null coalescing operator to fix issues when npm_config_user_agent exists (#1519)
1 parent 3b3e7f1 commit b4465ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ if (a == 'init') {
1515
w(n, JSON.stringify(o, 0, /\t/.test(s) ? '\t' : 2) + '\n')
1616
p.stdout.write(i())
1717
try { f.mkdirSync('.husky') } catch {}
18-
w('.husky/pre-commit', p.env.npm_config_user_agent?.split('/')[0] ?? 'npm' + ' test\n')
18+
w('.husky/pre-commit', (p.env.npm_config_user_agent?.split('/')[0] ?? 'npm') + ' test\n')
1919
p.exit()
2020
}
2121

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

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

0 commit comments

Comments
 (0)