diff --git a/packages/vuepress/cli.js b/packages/vuepress/cli.js index 35050b4f62..f34aa1865a 100755 --- a/packages/vuepress/cli.js +++ b/packages/vuepress/cli.js @@ -1,5 +1,7 @@ #!/usr/bin/env node +const updateNotifier = require('update-notifier') + const checkEnv = require('./lib/checkEnv') const { CLI } = require('./lib/util') const registerCoreCommands = require('./lib/registerCoreCommands') @@ -13,6 +15,7 @@ CLI({ async beforeParse (cli) { const pkg = require('@vuepress/core/package.json') checkEnv(pkg) + updateNotifier({ pkg }).notify() registerCoreCommands(cli, OPTIONS) await handleUnknownCommand(cli, OPTIONS) cli.version(pkg.version).help() diff --git a/packages/vuepress/package.json b/packages/vuepress/package.json index 4b6fb9398f..fd448c1352 100644 --- a/packages/vuepress/package.json +++ b/packages/vuepress/package.json @@ -36,7 +36,8 @@ "@vuepress/theme-default": "^1.2.0", "cac": "^6.3.9", "envinfo": "^7.2.0", - "opencollective-postinstall": "^2.0.2" + "opencollective-postinstall": "^2.0.2", + "update-notifier": "^4.0.0" }, "collective": { "type": "opencollective",