Skip to content

Commit 4fb8a3d

Browse files
committed
fix(versioner): simplify registry logging
1 parent 60b10d0 commit 4fb8a3d

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

packages/versioner/src/versioner.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,23 +155,17 @@ const publish = async (cwd: string) => {
155155
}
156156

157157
const registryOverrideRaw = argv.registry;
158-
if (registryOverrideRaw != null && typeof registryOverrideRaw !== 'string') {
158+
if (argv.registry && typeof argv.registry !== 'string') {
159159
throw new TypeError(
160160
`--registry must be a string (e.g. "${DEFAULT_NPM_REGISTRY}"), received ${typeof registryOverrideRaw}: ${String(
161-
registryOverrideRaw
161+
argv.registry
162162
)}`
163163
);
164164
}
165165

166-
const registryOverride = registryOverrideRaw == null ? null : registryOverrideRaw.trim();
167-
if (registryOverride != null && registryOverride.length === 0) {
168-
throw new TypeError(`--registry must be a non-empty string (e.g. "${DEFAULT_NPM_REGISTRY}")`);
169-
}
170-
171-
const registry = (registryOverride || DEFAULT_NPM_REGISTRY).replace(/\/+$/, '');
166+
const registry = argv.registry || DEFAULT_NPM_REGISTRY;
172167

173-
log.info(chalk`\n{cyan Publishing to registry}`);
174-
log.info(chalk`{grey Registry:} ${registry}`);
168+
log.info(chalk`\n{cyan Publishing to NPM}: {grey ${registry}}`);
175169

176170
const packDir = mkdtempSync(join(tmpdir(), 'versioner-pack-'));
177171
try {

0 commit comments

Comments
 (0)