File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments