Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default npm registry to config.npmRegistry #588

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hooks/init/check-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
// do not show warning if running `update` command of <CLI>_SKIP_NEW_VERSION_CHECK=true
if (argv[2] === 'update' || config.scopedEnvVarTrue('SKIP_NEW_VERSION_CHECK')) return

// TODO: handle prerelease channels

Check warning on line 95 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (lts/*)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'

Check warning on line 95 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (lts/-1)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'

Check warning on line 95 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / windows-unit-tests / windows-unit-tests (lts/*)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'

Check warning on line 95 in src/hooks/init/check-update.ts

View workflow job for this annotation

GitHub Actions / windows-unit-tests / windows-unit-tests (lts/-1)

Unexpected 'todo' comment: 'TODO: handle prerelease channels'
if (config.version.includes('-')) return

const {frequency, frequencyUnit} = config.pjson.oclif['warn-if-update-available'] ?? {}
Expand Down Expand Up @@ -124,7 +124,7 @@
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 {
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