From 0e8a15c73ad6f9299861c2f124b6c3bf408c96b4 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Fri, 19 Oct 2018 18:39:22 +0200 Subject: [PATCH] refactor(schematics): better ng-update success message * Instead of just saying "Complete..." we should make clear which `ng-update` schematic ran. This is necessary because the CDK and Material update runs independently. --- src/cdk/schematics/ng-update/index.ts | 11 ++++++++--- src/lib/schematics/ng-update/index.ts | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/cdk/schematics/ng-update/index.ts b/src/cdk/schematics/ng-update/index.ts index 400db3a7693a..8b4d649f593d 100644 --- a/src/cdk/schematics/ng-update/index.ts +++ b/src/cdk/schematics/ng-update/index.ts @@ -7,6 +7,7 @@ */ import {Rule} from '@angular-devkit/schematics'; +import {green, yellow} from 'chalk'; import {TargetVersion} from './target-version'; import {cdkUpgradeData} from './upgrade-data'; import {createUpgradeRule} from './upgrade-rules'; @@ -36,7 +37,11 @@ export function updateToV7(): Rule { /** Post-update schematic to be called when update is finished. */ export function postUpdate(): Rule { - return () => console.log( - '\nComplete! Please check the output above for any issues that were detected but could not' + - ' be automatically fixed.'); + return () => { + console.log(); + console.log(green(' ✓ Angular CDK update complete')); + console.log(); + console.log(yellow(' ⚠ Please check the output above for any issues that were detected ' + + 'but could not be automatically fixed.')); + }; } diff --git a/src/lib/schematics/ng-update/index.ts b/src/lib/schematics/ng-update/index.ts index 5708adaeb211..f135b63c7fb9 100644 --- a/src/lib/schematics/ng-update/index.ts +++ b/src/lib/schematics/ng-update/index.ts @@ -8,6 +8,7 @@ import {Rule} from '@angular-devkit/schematics'; import {TargetVersion, createUpgradeRule, UpgradeTSLintConfig} from '@angular/cdk/schematics'; +import {green, yellow} from 'chalk'; import {sync as globSync} from 'glob'; import {materialUpgradeData} from './upgrade-data'; @@ -47,7 +48,11 @@ export function updateToV7(): Rule { /** Post-update schematic to be called when update is finished. */ export function postUpdate(): Rule { - return () => console.log( - '\nComplete! Please check the output above for any issues that were detected but could not' + - ' be automatically fixed.'); + return () => { + console.log(); + console.log(green(' ✓ Angular Material update complete')); + console.log(); + console.log(yellow(' ⚠ Please check the output above for any issues that were detected ' + + 'but could not be automatically fixed.')); + }; }