From 5152cb9fb6c5bb468e798ab49f2ebba3d03687e6 Mon Sep 17 00:00:00 2001 From: dnlup Date: Sun, 29 Oct 2017 00:11:29 +0200 Subject: [PATCH 1/2] feat(update-notifier): Add update notifer Every time the cli si run update notifier will check for updates with the default options. --- package.json | 1 + src/index.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/package.json b/package.json index 1e8e450..cc68eae 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "axios": "^0.16.2", "babel-polyfill": "^6.26.0", "number-abbreviate": "^2.0.0", + "update-notifier": "^2.3.0", "yargs": "^10.0.3" }, "devDependencies": { diff --git a/src/index.js b/src/index.js index 36e68a9..eca67f3 100755 --- a/src/index.js +++ b/src/index.js @@ -3,15 +3,21 @@ import 'babel-polyfill'; import yargs from 'yargs'; import abbreviate from 'number-abbreviate'; +import updateNotifier from 'update-notifier' import playList from './playlist'; +const pkg = require('../package.json') + const { YOUTUBE_PLAYLIST_SORTER_API_KEY } = process.env; if (!YOUTUBE_PLAYLIST_SORTER_API_KEY) { console.error('YOUTUBE_PLAYLIST_SORTER_API_KEY not found in env vars'); process.exit(1); } +// Check for updates and notify if available +updateNotifier({pkg}).notify() + const argv = yargs .usage('$0 ') .demandCommand(1, 1, 'Youtube Playlist URL not provided!', 'Only 1 Youtube Playlist URL needed!') From 41547afcc564c9343b95462f1a4bff3888020202 Mon Sep 17 00:00:00 2001 From: dnlup Date: Sun, 29 Oct 2017 01:10:43 +0200 Subject: [PATCH 2/2] fix(formatting): Fix formatting style --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index eca67f3..7c31a47 100755 --- a/src/index.js +++ b/src/index.js @@ -3,11 +3,11 @@ import 'babel-polyfill'; import yargs from 'yargs'; import abbreviate from 'number-abbreviate'; -import updateNotifier from 'update-notifier' +import updateNotifier from 'update-notifier'; import playList from './playlist'; -const pkg = require('../package.json') +const pkg = require('../package.json'); const { YOUTUBE_PLAYLIST_SORTER_API_KEY } = process.env; if (!YOUTUBE_PLAYLIST_SORTER_API_KEY) { @@ -16,7 +16,7 @@ if (!YOUTUBE_PLAYLIST_SORTER_API_KEY) { } // Check for updates and notify if available -updateNotifier({pkg}).notify() +updateNotifier({ pkg }).notify(); const argv = yargs .usage('$0 ')