Skip to content

Commit

Permalink
fix: default npm registry to config.npmRegistry (#588)
Browse files Browse the repository at this point in the history
* fix: default npm registry to config.npmRegistry

* chore: clean up
  • Loading branch information
mdonnalley authored Apr 24, 2024
1 parent aa4c128 commit 749f1ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/init/check-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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'] ?? {}

Expand Down

0 comments on commit 749f1ba

Please sign in to comment.