Skip to content

Commit

Permalink
fix(@angular/cli): improve logs in ng update
Browse files Browse the repository at this point in the history
These addresses;
- When a large number of migration are executed, it's hard to differentiate between the title and description.
- Fix alignments of logs
  • Loading branch information
alan-agius4 authored and clydin committed Sep 14, 2020
1 parent 9144cf8 commit a21eb15
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/angular/cli/commands/update-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
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 = [];
}
}
Expand Down Expand Up @@ -231,7 +231,16 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
commit = false,
): Promise<boolean> {
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) {
Expand Down

0 comments on commit a21eb15

Please sign in to comment.