From 097ee6ef853b74b723ea3a5ed73decaab414a2c8 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Sat, 24 Mar 2018 14:20:01 -0700 Subject: [PATCH] feat: add some color --- src/hooks/init/check_update.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hooks/init/check_update.ts b/src/hooks/init/check_update.ts index cbaa33c2..53c989dd 100644 --- a/src/hooks/init/check_update.ts +++ b/src/hooks/init/check_update.ts @@ -1,4 +1,5 @@ import {Hook} from '@oclif/config' +import Chalk from 'chalk' import {spawn} from 'child_process' import * as fs from 'fs-extra' import * as path from 'path' @@ -13,7 +14,8 @@ const hook: Hook<'init'> = async function ({config}) { try { const distTags = await fs.readJSON(file) if (distTags && distTags.latest && semver.gt(distTags.latest, config.version)) { - this.warn(`${config.name} update available to ${distTags.latest} from ${config.version}`) + const chalk: typeof Chalk = require('chalk') + this.warn(`${config.name} update available to ${chalk.greenBright(distTags.latest)} from ${chalk.greenBright(config.version)}`) } } catch (err) { if (err.code !== 'ENOENT') throw err