cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jso...@apache.org
Subject [4/4] git commit: Support variable == width
Date Fri, 22 Aug 2014 19:29:51 GMT
Support variable == width

+ support in repo-update


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

Branch: refs/heads/master
Commit: 4ef3e11ee72491110f7fa6d4d726ff4af12897e5
Parents: 228257c
Author: Josh Soref <jsoref@blackberry.com>
Authored: Thu Aug 21 14:05:52 2014 -0400
Committer: Josh Soref <jsoref@blackberry.com>
Committed: Fri Aug 22 15:29:19 2014 -0400

----------------------------------------------------------------------
 src/apputil.js     | 4 +++-
 src/repo-update.js | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/4ef3e11e/src/apputil.js
----------------------------------------------------------------------
diff --git a/src/apputil.js b/src/apputil.js
index c729d81..dc640e6 100644
--- a/src/apputil.js
+++ b/src/apputil.js
@@ -42,6 +42,8 @@ exports.fatal = function() {
     process.exit(1);
 };
 
+exports.prefixLength = 30;
+
 exports.print = function() {
     var newArgs = Array.prototype.slice.call(arguments);
     // Prefix any prints() to distinguish them from command output.
@@ -49,7 +51,7 @@ exports.print = function() {
         var curDir = path.relative(baseWorkingDir, process.cwd());
         curDir = curDir ? curDir + '/' : './';
         var banner = ' =';
-        var PREFIX_LEN = 30;
+        var PREFIX_LEN = exports.prefixLength;
         if (curDir.length < PREFIX_LEN) {
             banner += new Array(PREFIX_LEN - curDir.length + 1).join('=');
         }

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/4ef3e11e/src/repo-update.js
----------------------------------------------------------------------
diff --git a/src/repo-update.js b/src/repo-update.js
index 7f06514..4e08a36 100644
--- a/src/repo-update.js
+++ b/src/repo-update.js
@@ -60,6 +60,10 @@ module.exports = function*(argv) {
     }
     var branches = Array.isArray(argv.b) ? argv.b : [argv.b];
     var repos = flagutil.computeReposFromFlag(argv.r);
+    apputil.prefixLength = Math.max.apply(null,
+        [apputil.prefixLength].concat(
+            repos.map(function (r) { return r.repoName.length + 2; }))
+        );
 
     // ensure that any missing repos are cloned
     yield require('./repo-clone').cloneRepos(repos,true);


Mime
View raw message