Skip to content

Commit

Permalink
feat(@angular/cli): log number of files update during ng update
Browse files Browse the repository at this point in the history
This commit updates `ng update` to include the number of files updated when a migration is completed.

Closes #24488
  • Loading branch information
alan-agius4 authored and angular-robot[bot] committed Jan 19, 2023
1 parent d19f260 commit 0f58a17
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions packages/angular/cli/src/commands/update/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,29 @@ export class UpdateCommandModule extends CommandModule<UpdateCommandArgs> {
logger.info(' ' + description.join('.\n '));
}

const result = await this.executeSchematic(
const { success, files } = await this.executeSchematic(
workflow,
migration.collection.name,
migration.name,
);
if (!result.success) {
if (!success) {
return 1;
}

logger.info(' Migration completed.');
let modifiedFilesText: string;
switch (files.size) {
case 0:
modifiedFilesText = 'No changes made';
break;
case 1:
modifiedFilesText = '1 file modified';
break;
default:
modifiedFilesText = `${files.size} files modified`;
break;
}

logger.info(` Migration completed (${modifiedFilesText}).`);

// Commit migration
if (commit) {
Expand Down

0 comments on commit 0f58a17

Please sign in to comment.