Skip to content

Commit 7a09a72

Browse files
jamesgeorge007kefranabg
authored andcommittedJan 12, 2020
feat($cli): Notify users of a newer release (#2121)
1 parent 28380d2 commit 7a09a72

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎packages/vuepress/cli.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
const updateNotifier = require('update-notifier')
4+
35
const checkEnv = require('./lib/checkEnv')
46
const { CLI } = require('./lib/util')
57
const registerCoreCommands = require('./lib/registerCoreCommands')
@@ -13,6 +15,7 @@ CLI({
1315
async beforeParse (cli) {
1416
const pkg = require('@vuepress/core/package.json')
1517
checkEnv(pkg)
18+
updateNotifier({ pkg }).notify()
1619
registerCoreCommands(cli, OPTIONS)
1720
await handleUnknownCommand(cli, OPTIONS)
1821
cli.version(pkg.version).help()

‎packages/vuepress/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"@vuepress/theme-default": "^1.2.0",
3737
"cac": "^6.3.9",
3838
"envinfo": "^7.2.0",
39-
"opencollective-postinstall": "^2.0.2"
39+
"opencollective-postinstall": "^2.0.2",
40+
"update-notifier": "^4.0.0"
4041
},
4142
"collective": {
4243
"type": "opencollective",

0 commit comments

Comments
 (0)
Please sign in to comment.