cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [20/22] git commit: adding search results
Date Thu, 11 Jul 2013 20:29:27 GMT
adding search results


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

Branch: refs/heads/plugman-registry
Commit: dc8caca0af617b4f4d720eb8439d82b01326e89e
Parents: 5ec2924
Author: Anis Kadri <anis@apache.org>
Authored: Wed Jun 19 14:50:33 2013 -0700
Committer: Anis Kadri <anis@apache.org>
Committed: Thu Jul 11 13:13:29 2013 -0700

----------------------------------------------------------------------
 main.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/dc8caca0/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 7baebe6..b695953 100755
--- a/main.js
+++ b/main.js
@@ -93,7 +93,7 @@ else if (cli_opts.adduser) {
 else if (cli_opts.publish) {
   registry.use(config.registry, function(err) {
     registry.publish([cli_opts.plugin], function(err, d) {
-      if(err) return console.log('Error publishing plugin'); 
+      if(err) return console.log('Error publishing plugin', err); 
       console.log('plugin published');
     });
   });
@@ -108,12 +108,15 @@ else if (cli_opts.unpublish) {
 }
 else if (cli_opts.search) {
   registry.use(config.registry, function(err) {
-    registry.search(cli_opts.search.split(','), function(err, d) {
+    registry.search(cli_opts.search.split(','), function(err, plugins) {
       if(err) return console.log(err); 
+      for(var plugin in plugins) {
+        console.log(plugins[plugin].name, '-', plugins[plugin].description || 'no description
provided'); 
+      }
     });
   });
 }
-else {
+else if(cli_opts.install) {
     var cli_variables = {}
     if (cli_opts.variable) {
         cli_opts.variable.forEach(function (variable) {
@@ -128,4 +131,6 @@ else {
         www_dir: cli_opts.www
     };
     plugman.install(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, opts);
+} else {
+  printUsage();
 }


Mime
View raw message