You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2017/05/02 21:05:21 UTC

cordova-coho git commit: Added (—global, -g) option, equivalent to —no-chdir

Repository: cordova-coho
Updated Branches:
  refs/heads/master 667db4ee6 -> bbce26ee5


Added (—global, -g) option, equivalent to —no-chdir

This is in anticipation of publishing this again to npm, after 3 long years.
This will also help for new contributor use.
Alas, we can’t make -g the default since it will break current users.


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

Branch: refs/heads/master
Commit: bbce26ee5a2482a1d6e1d911ed57b1b620a0db31
Parents: 667db4e
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Tue May 2 14:01:54 2017 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Tue May 2 14:01:54 2017 -0700

----------------------------------------------------------------------
 src/main.js | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/bbce26ee/src/main.js
----------------------------------------------------------------------
diff --git a/src/main.js b/src/main.js
index ae510b9..d6c13cc 100644
--- a/src/main.js
+++ b/src/main.js
@@ -201,7 +201,21 @@ module.exports = function() {
             desc: 'Enable verbose logging',
             type: 'boolean',
             default: false
-        });
+        })
+        .options('global', {
+            desc: 'Global use of coho, equivalent to --no-chdir',
+            type: 'boolean',
+            default: false
+        })
+        .alias('global', 'g');
+
+    if (optimist.argv.global) {
+        if (command) {
+            // if global is set, it is essentially --no-chdir
+            command.noChdir = true;
+        }
+    }
+        
     if (command && !command.noChdir) {
         opts = opts.options('chdir', {
             desc: 'Use --no-chdir to run in your CWD instead of the parent of cordova-coho/',


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