Skip to content

Commit 94b48d7

Browse files
alan-agius4vikerman
authored andcommitted
fix(@angular/cli): improve statues and description logs during update
With this change we improve the log messages of migration; > the migration description > the outcome of the migration > we also remove the version of the migration which was misleading (Ex: 9.0.0-beta)
1 parent 77714cc commit 94b48d7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

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

+11-5
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,12 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
166166

167167
migrations.sort((a, b) => semver.compare(a.version, b.version) || a.name.localeCompare(b.name));
168168

169+
this.logger.info(
170+
colors.cyan(`** Executing migrations of package '${packageName}' **\n`),
171+
);
172+
169173
for (const migration of migrations) {
170-
this.logger.info(
171-
`** Executing migrations for version ${migration.version} of package '${packageName}' **`,
172-
);
174+
this.logger.info(`${colors.symbols.pointer} ${migration.description.replace(/\. /g, '.\n ')}`);
173175

174176
const result = await this.executeSchematic(migration.collection.name, migration.name);
175177
if (!result.success) {
@@ -180,6 +182,8 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
180182
}
181183
}
182184

185+
this.logger.error(`${colors.symbols.cross} Migration failed. See above for further details.\n`);
186+
183187
return false;
184188
}
185189

@@ -192,6 +196,8 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
192196
// TODO: Use result.files once package install tasks are accounted
193197
this.createCommit(message, []);
194198
}
199+
200+
this.logger.info(colors.green(`${colors.symbols.check} Migration succeeded.\n`));
195201
}
196202

197203
return true;
@@ -265,11 +271,11 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
265271
if (!statusCheck && !this.checkCleanGit()) {
266272
if (options.allowDirty) {
267273
this.logger.warn(
268-
'Repository is not clean. Update changes will be mixed with pre-existing changes.',
274+
'Repository is not clean. Update changes will be mixed with pre-existing changes.',
269275
);
270276
} else {
271277
this.logger.error(
272-
'Repository is not clean. Please commit or stash any changes before updating.',
278+
'Repository is not clean. Please commit or stash any changes before updating.',
273279
);
274280

275281
return 2;

0 commit comments

Comments
 (0)