mirror of
https://github.com/hanzoai/husky.git
synced 2026-09-24 16:59:45 +00:00
fix: add parens around the null coalescing operator to fix issues when npm_config_user_agent exists (#1519)
This commit is contained in:
@@ -15,7 +15,7 @@ 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()
|
||||
}
|
||||
|
||||
@@ -23,4 +23,4 @@ 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))
|
||||
|
||||
Reference in New Issue
Block a user