You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2015/09/16 10:10:59 UTC

cordova-cli git commit: CB-9523 Show out of date message for older cordova CLI

Repository: cordova-cli
Updated Branches:
  refs/heads/master 027f727a0 -> c5acc3dcb


CB-9523 Show out of date message for older cordova CLI

This closes #219


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/c5acc3dc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/c5acc3dc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/c5acc3dc

Branch: refs/heads/master
Commit: c5acc3dcbea7ac736f778e58cde23a38b467572a
Parents: 027f727
Author: daserge <da...@yandex.ru>
Authored: Thu Aug 20 20:24:20 2015 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Wed Sep 16 11:09:29 2015 +0300

----------------------------------------------------------------------
 README.md       |  1 +
 doc/cordova.txt |  1 +
 package.json    |  3 ++-
 src/cli.js      | 17 +++++++++++++++--
 4 files changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/c5acc3dc/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 1465d17..fcf928a 100644
--- a/README.md
+++ b/README.md
@@ -124,6 +124,7 @@ Now the `cordova` and `plugman` in your path are the local git versions. Don't f
 
 - `-d` or `--verbose` will pipe out more verbose output to your shell. You can also subscribe to `log` and `warn` events if you are consuming `cordova-cli` as a node module by calling `cordova.on('log', function() {})` or `cordova.on('warn', function() {})`.
 - `-v` or `--version` will print out the version of your `cordova-cli` install.
+- `--no-update-notifier` will disable updates check. Alternatively set `"optOut": true` in `~/.config/configstore/update-notifier-cordova.json` or set `NO_UPDATE_NOTIFIER` environment variable with any value (see details in [update-notifier docs](https://www.npmjs.com/package/update-notifier#user-settings)).
 
 # Project Directory Structure
 A Cordova application built with `cordova-cli` will have the following directory structure:

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/c5acc3dc/doc/cordova.txt
----------------------------------------------------------------------
diff --git a/doc/cordova.txt b/doc/cordova.txt
index 35b1ac8..568b1a5 100644
--- a/doc/cordova.txt
+++ b/doc/cordova.txt
@@ -34,3 +34,4 @@ Command-line Flags/Options
     -v, --version ...................... prints out this utility's version
     -d, --verbose ...................... debug mode produces verbose log output for all activity,
                                          including output of sub-commands cordova-cli invokes
+    --no-update-notifier ............... disables check for CLI updates

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/c5acc3dc/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 0fe3dd4..5aaf32f 100644
--- a/package.json
+++ b/package.json
@@ -32,7 +32,8 @@
     "cordova-lib": "5.3.1",
     "q": "1.0.1",
     "nopt": "3.0.1",
-    "underscore":"1.7.0"
+    "underscore": "1.7.0",
+    "update-notifier": "^0.5.0"
   },
   "devDependencies": {
     "istanbul": "^0.3.4",

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/c5acc3dc/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index 9d9bfb5..c141e48 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -27,7 +27,9 @@ var path = require('path'),
     fs = require('fs'),
     help = require('./help'),
     nopt,
-    _;
+    _,
+    updateNotifier,
+    pkg = require('../package.json');
 
 var cordova_lib = require('cordova-lib'),
     CordovaError = cordova_lib.CordovaError,
@@ -46,6 +48,7 @@ function init() {
     try {
         nopt = require('nopt');
         _ = require('underscore');
+        updateNotifier = require('update-notifier');
     } catch (e) {
         console.error(
             'Please run npm install from this directory:\n\t' +
@@ -55,6 +58,16 @@ function init() {
     }
 }
 
+function checkForUpdates() {
+    // Checks for available update and returns an instance
+    var notifier = updateNotifier({
+        pkg: pkg
+    });
+
+    // Notify using the built-in convenience method
+    notifier.notify();
+}
+
 module.exports = cli;
 function cli(inputArgs) {
     // When changing command line arguments, update doc/help.txt accordingly.
@@ -97,7 +110,7 @@ function cli(inputArgs) {
 
     init();
 
-
+    checkForUpdates();
 
     var args = nopt(knownOpts, shortHands, inputArgs);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org