cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikhi...@apache.org
Subject cordova-coho git commit: Add a verbose switch to see all the commands that coho is issuing
Date Fri, 19 Jun 2015 23:54:18 GMT
Repository: cordova-coho
Updated Branches:
  refs/heads/master 1cb0b39ed -> 018bd236b


Add a verbose switch to see all the commands that coho is issuing


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

Branch: refs/heads/master
Commit: 018bd236b761b1c2949942fd47d0a5b6670d98c6
Parents: 1cb0b39
Author: Nikhil Khandelwal <nikhilkh@microsoft.com>
Authored: Fri Jun 5 14:08:50 2015 -0700
Committer: Nikhil Khandelwal <nikhilkh@microsoft.com>
Committed: Fri Jun 19 16:44:10 2015 -0700

----------------------------------------------------------------------
 src/executil.js |  4 +++-
 src/main.js     | 10 ++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/018bd236/src/executil.js
----------------------------------------------------------------------
diff --git a/src/executil.js b/src/executil.js
index 6938a82..5893b91 100644
--- a/src/executil.js
+++ b/src/executil.js
@@ -32,6 +32,8 @@ function ARGS(s, var_args) {
 }
 exports.ARGS = ARGS;
 
+exports.verbose = false;
+
 // silent = false ==> print command and output
 // silent == true or 1 ==> don't print command, don't print output
 // silent == 2 ==> don't print command, print output
@@ -46,7 +48,7 @@ function execHelper(cmdAndArgs, silent, allowError) {
         gitCommitCount++;
     }
     cmdAndArgs[0] = cmdAndArgs[0].replace(/^git /, 'git -c color.ui=always ');
-    if (!silent || silent === 3) {
+    if (!silent || silent === 3 || exports.verbose) {
         print('Executing:', cmdAndArgs.join(' '));
     }
     var result = superspawn.spawn(cmdAndArgs[0], cmdAndArgs.slice(1), {stdio: (silent &&
(silent !== 2)) ? 'default' : 'inherit'});

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/018bd236/src/main.js
----------------------------------------------------------------------
diff --git a/src/main.js b/src/main.js
index aafe192..c90009a 100644
--- a/src/main.js
+++ b/src/main.js
@@ -18,6 +18,8 @@ under the License.
 */
 
 var path = require('path');
+var executil = require('./executil');
+
 try {
     var co = require('co');
     var optimist = require('optimist');
@@ -181,6 +183,11 @@ module.exports = function() {
     var command;
     var argv = optimist
         .usage(usage)
+        .options('verbose', {
+            desc: 'Enable verbose logging',
+            type: 'boolean',
+            default: false
+        })
         .check(function(argv) {
             command = argv._[0];
             if (!command) {
@@ -192,6 +199,9 @@ module.exports = function() {
             if (argv.r === true) {
                 throw 'No repositories specified, see list-repos';
             }
+            if (argv.verbose) {
+                executil.verbose = true;
+            }
         }).argv;
     if(!commandMap[command].noChdir) {
         optimist.options('chdir', {


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


Mime
View raw message