mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-27 03:21:55 -04:00
24 lines
674 B
TypeScript
24 lines
674 B
TypeScript
import chalk from 'chalk'
|
|
import {stripIndents} from 'common-tags'
|
|
import updateNotifier = require('update-notifier')
|
|
import pkg from './pnpmPkgJson'
|
|
|
|
export default function () {
|
|
const notifier = updateNotifier({ pkg })
|
|
const update = notifier.update
|
|
|
|
if (!update) {
|
|
return
|
|
}
|
|
|
|
const message = stripIndents`
|
|
Update available! ${chalk.red(update.current)} → ${chalk.green(update.latest)}
|
|
${chalk.magenta('Changelog:')} https://github.com/pnpm/pnpm/releases/tag/v${update.latest}
|
|
Run ${chalk.magenta('pnpm i -g pnpm')} to update!
|
|
|
|
Follow ${chalk.magenta('@pnpmjs')} for updates: https://twitter.com/pnpmjs
|
|
`
|
|
|
|
notifier.notify({ message })
|
|
}
|