From 749f1ba5cf0852893644a6587b3e0a3b6f26fcda Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Wed, 24 Apr 2024 09:50:21 -0600 Subject: [PATCH] fix: default npm registry to config.npmRegistry (#588) * fix: default npm registry to config.npmRegistry * chore: clean up --- src/hooks/init/check-update.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/init/check-update.ts b/src/hooks/init/check-update.ts index 19da7297..b94179d8 100644 --- a/src/hooks/init/check-update.ts +++ b/src/hooks/init/check-update.ts @@ -124,7 +124,7 @@ export async function getNewerVersion({ return distTags[tag] } -const hook: Hook<'init'> = async function ({config}) { +const hook: Hook.Init = async function ({config}) { const debug = makeDebug('update-check') const versionFile = join(config.cacheDir, 'version') const lastWarningFile = join(config.cacheDir, 'last-warning') @@ -133,7 +133,7 @@ const hook: Hook<'init'> = async function ({config}) { const { authorization = '', message = '<%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>.', - registry = 'https://registry.npmjs.org', + registry = config.npmRegistry ?? 'https://registry.npmjs.org', timeoutInDays = 60, } = config.pjson.oclif['warn-if-update-available'] ?? {}