Skip to content

Commit

Permalink
Merge pull request #177 from storyblok/feature/update-notifier
Browse files Browse the repository at this point in the history
Use of update-notifier to non-intrusive updates notify
  • Loading branch information
onefriendaday authored Jan 21, 2020
2 parents 47f7cd7 + 9257773 commit b9ac410
Show file tree
Hide file tree
Showing 3 changed files with 427 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"opn": "^5.1.0",
"path": "^0.12.7",
"storyblok-js-client": "^2.0.10",
"unirest": "^0.5.1"
"unirest": "^0.5.1",
"update-notifier": "^4.0.0"
},
"engines": {
"node": ">=9.11.0"
Expand Down
11 changes: 11 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const clear = require('clear')
const figlet = require('figlet')
const inquirer = require('inquirer')

const updateNotifier = require('update-notifier')
const pkg = require('../package.json')

const tasks = require('./tasks')
const { getQuestions, lastStep, api, creds } = require('./utils')
const { SYNC_TYPES } = require('./constants')
Expand All @@ -19,6 +22,14 @@ console.log()
console.log('Hi, welcome to the Storyblok CLI')
console.log()

// non-intrusive notify users if an update available
const notifyOptions = {
isGlobal: true
}

updateNotifier({ pkg })
.notify(notifyOptions)

program
.option('-s, --space [value]', 'space ID')

Expand Down
Loading

0 comments on commit b9ac410

Please sign in to comment.