From 073db6806314ec6cad5239d7b2860b37b870b804 Mon Sep 17 00:00:00 2001 From: Anup Date: Thu, 7 Sep 2017 17:07:47 +0530 Subject: [PATCH 1/3] Adds update-notifier --- package.json | 1 + src/index.js | 3 +++ yarn.lock | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 81d31d45d..9d81a2252 100644 --- a/package.json +++ b/package.json @@ -154,6 +154,7 @@ "sw-precache-webpack-plugin": "^0.11.2", "tmp": "0.0.31", "unfetch": "^3.0.0", + "update-notifier": "^2.2.0", "url-loader": "^0.5.8", "webpack": "^2.3.3", "webpack-chunk-hash": "^0.4.0", diff --git a/src/index.js b/src/index.js index cc654767b..9924d0efe 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,7 @@ import installHooks from './lib/output-hooks'; import pkg from '../package.json'; import logo from './lib/logo'; import checkVersion from './../check'; +import updateNotifier from 'update-notifier'; global.Promise = require('bluebird'); @@ -31,3 +32,5 @@ yargs .demandCommand() .strict() .argv; + +updateNotifier({pkg}).notify({ defer: true }); diff --git a/yarn.lock b/yarn.lock index 63dda8b91..7120e63ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7288,7 +7288,7 @@ update-notifier@^1.0.3: semver-diff "^2.0.0" xdg-basedir "^2.0.0" -update-notifier@^2.1.0: +update-notifier@^2.1.0, update-notifier@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.2.0.tgz#1b5837cf90c0736d88627732b661c138f86de72f" dependencies: From 7f5a6d53a15a06b6926a1fab833691dd7c4e600c Mon Sep 17 00:00:00 2001 From: Anup Date: Fri, 8 Sep 2017 11:58:14 +0530 Subject: [PATCH 2/3] Move updater.notify() before yargs --- src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 9924d0efe..21893e2bd 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +import updateNotifier from 'update-notifier'; import yargs from 'yargs'; import create from './commands/create'; import build from './commands/build'; @@ -9,7 +10,6 @@ import installHooks from './lib/output-hooks'; import pkg from '../package.json'; import logo from './lib/logo'; import checkVersion from './../check'; -import updateNotifier from 'update-notifier'; global.Promise = require('bluebird'); @@ -17,6 +17,8 @@ checkVersion(); installHooks(); +updateNotifier({pkg}).notify({ defer: true }); + yargs .command(create) .command(build) @@ -33,4 +35,3 @@ yargs .strict() .argv; -updateNotifier({pkg}).notify({ defer: true }); From 140bb78d00d9f307ed115e1a07b758c9aee45932 Mon Sep 17 00:00:00 2001 From: Anup Date: Fri, 8 Sep 2017 12:02:30 +0530 Subject: [PATCH 3/3] Remove defer --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 21893e2bd..c6d599375 100644 --- a/src/index.js +++ b/src/index.js @@ -17,7 +17,7 @@ checkVersion(); installHooks(); -updateNotifier({pkg}).notify({ defer: true }); +updateNotifier({pkg}).notify(); yargs .command(create)