Skip to content

Commit

Permalink
fix(@angular/cli): merge npmrc files values
Browse files Browse the repository at this point in the history
Closes #21406

(cherry picked from commit 259e269)
  • Loading branch information
alan-agius4 authored and clydin committed Jul 23, 2021
1 parent 03b0386 commit e02c97d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/angular/cli/utilities/package-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function readOptions(
// See: https://github.com/npm/npm-registry-fetch/blob/ebddbe78a5f67118c1f7af2e02c8a22bcaf9e850/index.js#L99-L126
const rcConfig: PackageManagerOptions = yarn ? lockfile.parse(data) : ini.parse(data);

rcOptions = normalizeOptions(rcConfig, location);
rcOptions = normalizeOptions(rcConfig, location, rcOptions);
}
}

Expand All @@ -166,17 +166,15 @@ function readOptions(
envVariablesOptions[normalizedName] = value;
}

return {
...rcOptions,
...normalizeOptions(envVariablesOptions),
};
return normalizeOptions(envVariablesOptions, undefined, rcOptions);
}

function normalizeOptions(
rawOptions: PackageManagerOptions,
location = process.cwd(),
existingNormalizedOptions: PackageManagerOptions = {},
): PackageManagerOptions {
const options: PackageManagerOptions = {};
const options = { ...existingNormalizedOptions };

for (const [key, value] of Object.entries(rawOptions)) {
let substitutedValue = value;
Expand Down

0 comments on commit e02c97d

Please sign in to comment.