cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lorinb...@apache.org
Subject [01/15] git commit: created init function to handle initalization of underscore and nopt
Date Thu, 21 Aug 2014 18:23:02 GMT
Repository: cordova-cli
Updated Branches:
  refs/heads/master c2131da23 -> f4df7ae9c


created init function to handle initalization of underscore and nopt

it should not be necessary to initialize and catch uninstalled dependencies as a general rule.
This would only affect users that have cloned the repo but failed to perform a local npm install


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

Branch: refs/heads/master
Commit: 68d0d9f17cd12289999ecadae852522416526868
Parents: b85bee7
Author: Lorin Beer <lorin.beer@gmail.com>
Authored: Fri Jun 13 09:46:09 2014 -0700
Committer: Lorin Beer <lorin.beer@gmail.com>
Committed: Wed Aug 20 11:14:21 2014 -0700

----------------------------------------------------------------------
 src/cli.js | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/68d0d9f1/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index 8496420..363cb39 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -23,18 +23,19 @@
 */
 
 
-var path = require('path')
-,   help = require('./help')
-,   fs = require('fs');
-
-// nopt and underscore are require()d in try-catch below to print a nice error
-// message if one of them is not installed.
-var nopt, _;
-
-
-module.exports = cli;
-function cli(inputArgs) {
+var path = require('path'),
+    help = require('./help'),
+    nopt, 
+    _;
 
+/*
+ * init
+ *
+ * initializes nopt and underscore 
+ * nopt and underscore are require()d in try-catch below to print a nice error
+ * message if one of them is not installed.
+ */
+function init() {
     try {
         nopt = require('nopt');
         _ = require('underscore');
@@ -45,7 +46,10 @@ function cli(inputArgs) {
         );
         process.exit(2);
     }
+};
 
+module.exports = cli
+function cli(inputArgs) {
     // When changing command line arguments, update doc/help.txt accordingly.
     var knownOpts =
         { 'verbose' : Boolean


Mime
View raw message