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
  • Loading branch information
alan-agius4 authored and clydin committed Nov 9, 2021
1 parent b15472a commit b7b1325
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
Original file line number Diff line number Diff line change
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 b7b1325

Please sign in to comment.