Skip to content

Commit

Permalink
fix(@angular/cli): favor ng-update packageGroupName in ng update ou…
Browse files Browse the repository at this point in the history
…tput

With this change we favor the `packageGroupName` name when specified and only fallback to use the first item in in the `packageGroup` array when it is not specified.

Closes #22087

(cherry picked from commit b7b1325)
  • Loading branch information
alan-agius4 authored and clydin committed Nov 9, 2021
1 parent 9ea74a1 commit ff4538e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/angular/cli/src/commands/update/schematic/index.ts
Expand Up @@ -460,17 +460,15 @@ function _usageMessage(
target,
};
})
.filter(({ info, version, target }) => {
return target && semver.compare(info.installed.version, version) < 0;
})
.filter(({ target }) => {
return target['ng-update'];
})
.filter(
({ info, version, target }) =>
target?.['ng-update'] && semver.compare(info.installed.version, version) < 0,
)
.map(({ name, info, version, tag, target }) => {
// Look for packageGroup.
const packageGroup = target['ng-update']?.['packageGroup'];
const packageGroup = target['ng-update']['packageGroup'];
if (packageGroup) {
const packageGroupName = packageGroup?.[0];
const packageGroupName = target['ng-update']['packageGroupName'] || packageGroup[0];
if (packageGroupName) {
if (packageGroups.has(name)) {
return null;
Expand Down

0 comments on commit ff4538e

Please sign in to comment.