Skip to content

Commit a21eb15

Browse files
alan-agius4clydin
authored andcommitted
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
1 parent 9144cf8 commit a21eb15

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/angular/cli/commands/update-impl.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
123123
if (event.kind == 'end' || event.kind == 'post-tasks-start') {
124124
if (!error) {
125125
// Output the logging queue, no error happened.
126-
logs.forEach(log => this.logger.info(log));
126+
logs.forEach(log => this.logger.info(` ${log}`));
127127
logs = [];
128128
}
129129
}
@@ -231,7 +231,16 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
231231
commit = false,
232232
): Promise<boolean> {
233233
for (const migration of migrations) {
234-
this.logger.info(`${colors.symbols.pointer} ${migration.description.replace(/\. /g, '.\n ')}`);
234+
const [title, ...description] = migration.description.split('. ');
235+
236+
this.logger.info(
237+
colors.cyan(colors.symbols.pointer) + ' ' +
238+
colors.bold(title.endsWith('.') ? title : title + '.'),
239+
);
240+
241+
if (description.length) {
242+
this.logger.info(' ' + description.join('.\n '));
243+
}
235244

236245
const result = await this.executeSchematic(migration.collection.name, migration.name);
237246
if (!result.success) {

0 commit comments

Comments
 (0)