Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert: "fix: don't add trailing slash to registry URLs (#4032)"
This reverts commit a7ff2d5.
- Loading branch information
Showing
9 changed files
with
27 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import normalizeRegistryUrl from 'normalize-registry-url' | ||
|
||
export default function getScopeRegistries (rawConfig: Object) { | ||
const registries = {} | ||
for (const configKey of Object.keys(rawConfig)) { | ||
if (configKey[0] === '@' && configKey.endsWith(':registry')) { | ||
registries[configKey.substr(0, configKey.indexOf(':'))] = normalizeRegistryUrl(rawConfig[configKey]) | ||
registries[configKey.substr(0, configKey.indexOf(':'))] = normalizeRegistry(rawConfig[configKey]) | ||
} | ||
} | ||
return registries | ||
} | ||
|
||
export function normalizeRegistry (registry: string) { | ||
return registry.endsWith('/') ? registry : `${registry}/` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
@foo:registry=https://foo.com | ||
@bar:registry=https://bar.com | ||
@qar:registry=https://qar.com/qar | ||
registry=https://default.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.