Skip to content

Commit ab9398b

Browse files
authored
fix: process.env.npm_config_user_agent ?? Unexpected token '?'
1 parent 76d47da commit ab9398b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ async function init() {
361361
// Supported package managers: pnpm > yarn > npm
362362
// Note: until <https://github.com/pnpm/pnpm/issues/3505> is resolved,
363363
// it is not possible to tell if the command is called by `pnpm init`.
364-
const userAgent = process.env.npm_config_user_agent ?? ''
364+
const userAgent = process.env.npm_config_user_agent ? process.env.npm_config_user_agent : ''
365365
const packageManager = /pnpm/.test(userAgent) ? 'pnpm' : /yarn/.test(userAgent) ? 'yarn' : 'npm'
366366

367367
// README generation

0 commit comments

Comments
 (0)