Merge pull request #4301 from RafalWilinski/update-available-notification

Print message that an update is available if user runs Serverless command with an outdated version
This commit is contained in:
Takahiro Horike 2017-10-20 08:51:04 +09:00 committed by GitHub
commit 464d0b22b5
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,8 @@ require('shelljs/global');
const path = require('path');
const BbPromise = require('bluebird');
const os = require('os');
const updateNotifier = require('update-notifier');
const pkg = require('../package.json');
const CLI = require('./classes/CLI');
const Config = require('./classes/Config');
const YamlParser = require('./classes/YamlParser');
@ -58,6 +60,9 @@ class Serverless {
this.pluginManager.setCliOptions(this.processedInput.options);
this.pluginManager.setCliCommands(this.processedInput.commands);
// Check if update is available
updateNotifier({ pkg }).notify();
return this.service.load(this.processedInput.options)
.then(() => {
// load all plugins

View File

@ -122,6 +122,7 @@
"semver-regex": "^1.0.0",
"shelljs": "^0.6.0",
"tabtab": "^2.2.2",
"update-notifier": "^2.2.0",
"uuid": "^2.0.2",
"write-file-atomic": "^2.1.0",
"yaml-ast-parser": "0.0.34"