You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/04/24 17:45:45 UTC

git commit: list-repos module

Repository: cordova-coho
Updated Branches:
  refs/heads/master 4a1a4f112 -> 478366033


list-repos module


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

Branch: refs/heads/master
Commit: 478366033979a83cd1033fee504ef613099290e8
Parents: 4a1a4f1
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Apr 24 11:45:38 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Apr 24 11:45:38 2014 -0400

----------------------------------------------------------------------
 src/list-repos.js | 38 ++++++++++++++++++++++++++++++++++++++
 src/main.js       | 19 +------------------
 2 files changed, 39 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/47836603/src/list-repos.js
----------------------------------------------------------------------
diff --git a/src/list-repos.js b/src/list-repos.js
new file mode 100644
index 0000000..3afe570
--- /dev/null
+++ b/src/list-repos.js
@@ -0,0 +1,38 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+var repoutil = require('./repoutil');
+
+module.exports = function*(argv) {
+    console.log('Valid values for the --repo flag:');
+    console.log('');
+    console.log('Repositories:');
+    repoutil.repoGroups.all.forEach(function(repo) {
+        console.log('    ' + repo.id);
+    });
+    console.log('');
+    console.log('Repository Groups:');
+    var groupNames = Object.keys(repoutil.repoGroups);
+    groupNames.sort();
+    groupNames.forEach(function(groupName) {
+        console.log('    ' + groupName + ' (' + repoutil.repoGroups[groupName].map(function(repo) { return repo.id }).join(', ') + ')');
+    });
+    process.exit(0);
+}
+

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/47836603/src/main.js
----------------------------------------------------------------------
diff --git a/src/main.js b/src/main.js
index bcad09f..f694c19 100644
--- a/src/main.js
+++ b/src/main.js
@@ -104,23 +104,6 @@ function retrieveCurrentTagName() {
     return executil.execHelper(executil.ARGS('git describe --tags HEAD'), true, true);
 }
 
-function *listReposCommand(argv) {
-    console.log('Valid values for the --repo flag:');
-    console.log('');
-    console.log('Repositories:');
-    repoutil.repoGroups.all.forEach(function(repo) {
-        console.log('    ' + repo.id);
-    });
-    console.log('');
-    console.log('Repository Groups:');
-    var groupNames = Object.keys(repoutil.repoGroups);
-    groupNames.sort();
-    groupNames.forEach(function(groupName) {
-        console.log('    ' + groupName + ' (' + repoutil.repoGroups[groupName].map(function(repo) { return repo.id }).join(', ') + ')');
-    });
-    process.exit(0);
-}
-
 function *repoCloneCommand(argv) {
     var opt = flagutil.registerRepoFlag(optimist)
     opt = flagutil.registerHelpFlag(opt);
@@ -721,7 +704,7 @@ function main() {
         }, {
             name: 'list-repos',
             desc: 'Shows a list of valid values for the --repo flag.',
-            entryPoint: listReposCommand
+            entryPoint: require('./list-repos')
         }, {
             name: 'list-pulls',
             desc: 'Shows a list of GitHub pull requests for all specified repositories.',