You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ni...@apache.org on 2015/05/01 22:20:26 UTC

cordova-coho git commit: Allow support for `$r` to be a pseudo variable

Repository: cordova-coho
Updated Branches:
  refs/heads/master 8b03eaaa9 -> 3d6820d4e


Allow support for `$r` to be a pseudo variable


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

Branch: refs/heads/master
Commit: 3d6820d4eb4f5734bd52a2d156e97b9917299936
Parents: 8b03eaa
Author: Nikhil Khandelwal <ni...@microsoft.com>
Authored: Fri May 1 12:52:46 2015 -0700
Committer: Nikhil Khandelwal <ni...@microsoft.com>
Committed: Fri May 1 13:19:44 2015 -0700

----------------------------------------------------------------------
 src/for-each.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/3d6820d4/src/for-each.js
----------------------------------------------------------------------
diff --git a/src/for-each.js b/src/for-each.js
index 6421903..90f229b 100644
--- a/src/for-each.js
+++ b/src/for-each.js
@@ -29,6 +29,7 @@ module.exports = function*() {
     var argv = opt
         .usage('Performs the supplied shell command in each repo directory.\n' +
                '\n' +
+               'Use "$r" as pseudo variable for repo name' +
                'Usage: $0 for-each [-r reponame] "shell command"')
         .argv;
 
@@ -44,7 +45,11 @@ module.exports = function*() {
     }
 
     yield repoutil.forEachRepo(repos, function*(repo) {
-         yield executil.execHelper(cmd, false, true);
+         var replacedCmd = [];
+         for (var i = 0; i < cmd.length; i++) {
+            replacedCmd[i] = cmd[i].replace('$r', repo.repoName);    
+         }
+         yield executil.execHelper(replacedCmd, false, true);
     });
 }
 


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