Skip to content

Commit

Permalink
feat: add some color
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Mar 24, 2018
1 parent 4ef0237 commit 097ee6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hooks/init/check_update.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down

0 comments on commit 097ee6e

Please sign in to comment.