Skip to content

Commit

Permalink
fix(@angular/cli): add link to update guide post running Angular migr…
Browse files Browse the repository at this point in the history
…ations
  • Loading branch information
alan-agius4 authored and mgechev committed Nov 9, 2019
1 parent 2a1597a commit 524bff6
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/angular/cli/commands/update-impl.ts
Expand Up @@ -37,6 +37,11 @@ const pickManifest = require('npm-pick-manifest') as (

const oldConfigFileNames = ['.angular-cli.json', 'angular-cli.json'];

const NG_VERSION_9_POST_MSG = colors.cyan(
'\nYour project has been updated to Angular version 9!\n' +
'For more info, please see: https://v9.angular.io/guide/updating-to-version-9',
);

export class UpdateCommand extends Command<UpdateCommandSchema> {
public readonly allowMissingWorkspace = true;

Expand Down Expand Up @@ -428,7 +433,18 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
options.createCommits,
);

return success ? 0 : 1;
if (success) {
if (
packageName === '@angular/core'
&& (options.to || packageNode.package.version).split('.')[0] === '9'
) {
this.logger.info(NG_VERSION_9_POST_MSG);
}

return 0;
}

return 1;
}

const requests: {
Expand Down Expand Up @@ -565,6 +581,10 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
return 0;
}
}

if (migrations.some(m => m.package === '@angular/core' && m.to.split('.')[0] === '9')) {
this.logger.info(NG_VERSION_9_POST_MSG);
}
}

return success ? 0 : 1;
Expand Down

0 comments on commit 524bff6

Please sign in to comment.