cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject git commit: Starting point for list-release-urls command
Date Thu, 20 Feb 2014 19:59:38 GMT
Repository: cordova-coho
Updated Branches:
  refs/heads/master ae0cb3e27 -> e63ca040f


Starting point for list-release-urls command


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

Branch: refs/heads/master
Commit: e63ca040f6bbfa0bce37e132b5cd60e3de11a213
Parents: ae0cb3e
Author: Michal Mocny <mmocny@gmail.com>
Authored: Thu Feb 20 14:59:34 2014 -0500
Committer: Michal Mocny <mmocny@gmail.com>
Committed: Thu Feb 20 14:59:34 2014 -0500

----------------------------------------------------------------------
 coho | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/e63ca040/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index 9083e41..e6804bd 100755
--- a/coho
+++ b/coho
@@ -697,6 +697,38 @@ function computeReposFromFlag(flagValue) {
     return ret;
 }
 
+function listReleaseUrls(argv) {
+    var opt = registerRepoFlag(optimist)
+    opt = opt
+        .options('version', {
+            desc: 'The version of the release. E.g. 2.7.1-rc2',
+            demand: true
+         })
+    opt = registerHelpFlag(opt);
+    var argv = opt
+        .usage('.\n' +
+               'Usage: $0 list-release-urls')
+        .argv;
+
+    if (argv.h) {
+        optimist.showHelp();
+        process.exit(1);
+    }
+    var repos = computeReposFromFlag(argv.r);
+    var version = validateVersionString(argv['version']);
+
+    var baseUrl = 'http://git-wip-us.apache.org/repos/asf?p=%s.git;a=shortlog;h=refs/tags/%s';
+    forEachRepo(repos, function(repo) {
+        if (!tagExists(version)) {
+            console.error('Tag "' + version + '" does not exist in repo ' + repo.repoName);
+            return;
+        }
+        var url = require('util').format(baseUrl, repo.repoName, version);
+        console.log(url);
+        execHelper('git show-ref ' + version, 2, true);
+    });
+}
+
 function computeExistingRepos() {
     return allRepos.filter(function(repo) {
         return shjs.test('-d', repo.repoName);
@@ -1774,6 +1806,10 @@ function main() {
             name: 'foreach',
             desc: 'Runs a shell command in each repo.',
             entryPoint: repoPerformShellCommand
+        }, {
+            name: 'list-release-urls',
+            desc: 'List the apache git repo urls for release artifacts.',
+            entryPoint: listReleaseUrls
         }
     ];
     var commandMap = {};


Mime
View raw message