Skip to content

Commit 0f58a17

Browse files
alan-agius4angular-robot[bot]
authored andcommitted
feat(@angular/cli): log number of files update during ng update
This commit updates `ng update` to include the number of files updated when a migration is completed. Closes #24488
1 parent d19f260 commit 0f58a17

File tree

1 file changed

+16
-3
lines changed
  • packages/angular/cli/src/commands/update

1 file changed

+16
-3
lines changed

packages/angular/cli/src/commands/update/cli.ts

+16-3
Original file line numberDiff line numberDiff line change
@@ -387,16 +387,29 @@ export class UpdateCommandModule extends CommandModule<UpdateCommandArgs> {
387387
logger.info(' ' + description.join('.\n '));
388388
}
389389

390-
const result = await this.executeSchematic(
390+
const { success, files } = await this.executeSchematic(
391391
workflow,
392392
migration.collection.name,
393393
migration.name,
394394
);
395-
if (!result.success) {
395+
if (!success) {
396396
return 1;
397397
}
398398

399-
logger.info(' Migration completed.');
399+
let modifiedFilesText: string;
400+
switch (files.size) {
401+
case 0:
402+
modifiedFilesText = 'No changes made';
403+
break;
404+
case 1:
405+
modifiedFilesText = '1 file modified';
406+
break;
407+
default:
408+
modifiedFilesText = `${files.size} files modified`;
409+
break;
410+
}
411+
412+
logger.info(` Migration completed (${modifiedFilesText}).`);
400413

401414
// Commit migration
402415
if (commit) {

0 commit comments

Comments
 (0)