cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikhi...@apache.org
Subject cordova-coho git commit: Allow support for `$r` to be a pseudo variable
Date Fri, 01 May 2015 20:20:26 GMT
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 <nikhilkh@microsoft.com>
Authored: Fri May 1 12:52:46 2015 -0700
Committer: Nikhil Khandelwal <nikhilkh@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


Mime
View raw message