Skip to content

Commit

Permalink
Ensure that update message shows up (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
leo authored and rauchg committed Nov 7, 2017
1 parent aeaf03a commit e6e92a2
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/util/updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,11 @@ const chalk = require('chalk')
const pkg = require('./pkg')

module.exports = () => {
if (!process.pkg) {
return
}

const notifier = updateNotifier({ pkg })
const update = notifier.update
const { update } = updateNotifier({ pkg })

if (!update) {
return
}

let message = `Update available! ${chalk.red(
update.current
)}${chalk.green(update.latest)} \n`
message += `${chalk.magenta(
'Changelog:'
)} https://github.com/zeit/now-cli/releases/tag/${update.latest}\n`

if (pkg._npmPkg) {
message += `Run ${chalk.magenta('npm i -g now')} to update!`
} else {
message += `Please download binaries from https://zeit.co/download`
}

notifier.notify({ message })
console.log(`${chalk.white.bold.bgRed('UPDATE AVAILABLE')} The latest version of Now CLI is ${chalk.bold(update.latest)}`)
}

0 comments on commit e6e92a2

Please sign in to comment.