You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by js...@apache.org on 2014/08/22 21:29:49 UTC
[2/4] git commit: Handle symlinks to non sibling directories
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 <js...@blackberry.com>
Authored: Thu Aug 21 12:14:09 2014 -0400
Committer: Josh Soref <js...@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 || '';
}
}