cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jso...@apache.org
Subject [2/4] git commit: Handle symlinks to non sibling directories
Date Fri, 22 Aug 2014 19:29:49 GMT
Handle symlinks to non sibling directories


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

Branch: refs/heads/master
Commit: 939b5e150eb1e4f7399ac9919eb5b0ba44cba88a
Parents: 3f64478
Author: Josh Soref <jsoref@blackberry.com>
Authored: Thu Aug 21 12:14:09 2014 -0400
Committer: Josh Soref <jsoref@blackberry.com>
Committed: Fri Aug 22 15:28:23 2014 -0400

----------------------------------------------------------------------
 src/repoutil.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/939b5e15/src/repoutil.js
----------------------------------------------------------------------
diff --git a/src/repoutil.js b/src/repoutil.js
index c616962..615090d 100644
--- a/src/repoutil.js
+++ b/src/repoutil.js
@@ -415,23 +415,23 @@ function getRepoById(id, opt_repos) {
 }
 exports.getRepoById = getRepoById;
 
-var isInForEachRepoFunction = false;
+var isInForEachRepoFunction = '';
 
 exports.forEachRepo = function*(repos, func) {
     for (var i = 0; i < repos.length; ++i) {
         var repo = repos[i];
-        var origPath = isInForEachRepoFunction ? process.cwd() : '..';
-        var newPath = isInForEachRepoFunction ? path.join('..', repo.repoName) : repo.repoName;
+        var origPath = isInForEachRepoFunction || '..';
+        var newPath = path.join(isInForEachRepoFunction, repo.repoName);
 
-        isInForEachRepoFunction = true;
+        isInForEachRepoFunction = isInForEachRepoFunction || process.cwd();
         shelljs.cd(newPath);
         if (shelljs.error()) {
             apputil.fatal('Repo directory does not exist: ' + repo.repoName + '. First run
coho repo-clone.');
         }
         yield func(repo);
-        shelljs.cd(origPath);
+        shelljs.cd(isInForEachRepoFunction);
 
-        isInForEachRepoFunction = origPath != '..';
+        isInForEachRepoFunction = origPath != '..' && isInForEachRepoFunction ||
'';
     }
 }
 


Mime
View raw message