UNPKG

797 BJavaScriptView Raw
1const chalk = require('chalk')
2const upToDate = require('./up-to-date')
3const latestBlinkCli = require('./latest-blink-cli')
4
5const oldVersion = 'You are using an older version of blink-cli'
6const getBlinkCli = ' Install the latest version'
7const installCmd = ' npm i -g @tremorvideo/blink-cli'
8
9module.exports = async ({ pkg }) => {
10 const warnings = []
11 const details = []
12 const latest = await latestBlinkCli(pkg)
13 if (upToDate(pkg.version, latest)) {
14 details.push(chalk`You are using blink-cli version ${pkg.version} {green (up to date)}`)
15 } else {
16 details.push(chalk`You are using blink-cli version ${pkg.version} {red (not up to date)}`)
17 warnings.push(chalk`${oldVersion}\n${getBlinkCli} (v${latest})\n{italic.gray ${installCmd}}`)
18 }
19 return { warnings, details }
20}