Skip to content

Commit

Permalink
If unable to get option attempt to read option from other registries
Browse files Browse the repository at this point in the history
  • Loading branch information
otaku committed May 12, 2018
1 parent b88afa4 commit ced8487
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/registries/npm-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,20 @@ export default class NpmRegistry extends Registry {

getScopedOption(scope: string, option: string): mixed {
const key = scope + (scope ? ':' : '') + option;
return this.getOption(key) || this.registries.yarn.getOption(key);

let val = this.getOption(key);

if (typeof val === 'undefined') {
const registries = Object.keys(this.registries);
for (const registryName of registries) {
val = this.registries[registryName].getOption(key);
if (typeof val !== 'undefined') {
break;
}
}
}

return val;
}

getRegistryOption(registry: string, option: string): mixed {
Expand Down

0 comments on commit ced8487

Please sign in to comment.