From a21eb1588e308cea752c8536aae1800a266fc9db Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sat, 12 Sep 2020 18:33:37 +0200 Subject: [PATCH] fix(@angular/cli): improve logs in ng update These addresses; - When a large number of migration are executed, it's hard to differentiate between the title and description. - Fix alignments of logs --- packages/angular/cli/commands/update-impl.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/angular/cli/commands/update-impl.ts b/packages/angular/cli/commands/update-impl.ts index de07f4bccb59..a2fd81991b4c 100644 --- a/packages/angular/cli/commands/update-impl.ts +++ b/packages/angular/cli/commands/update-impl.ts @@ -123,7 +123,7 @@ export class UpdateCommand extends Command { if (event.kind == 'end' || event.kind == 'post-tasks-start') { if (!error) { // Output the logging queue, no error happened. - logs.forEach(log => this.logger.info(log)); + logs.forEach(log => this.logger.info(` ${log}`)); logs = []; } } @@ -231,7 +231,16 @@ export class UpdateCommand extends Command { commit = false, ): Promise { for (const migration of migrations) { - this.logger.info(`${colors.symbols.pointer} ${migration.description.replace(/\. /g, '.\n ')}`); + const [title, ...description] = migration.description.split('. '); + + this.logger.info( + colors.cyan(colors.symbols.pointer) + ' ' + + colors.bold(title.endsWith('.') ? title : title + '.'), + ); + + if (description.length) { + this.logger.info(' ' + description.join('.\n ')); + } const result = await this.executeSchematic(migration.collection.name, migration.name); if (!result.success) {