You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/07/25 00:07:13 UTC

git commit: Updated readme with a requirements section. Resolved [CB-4375]: error msgs get properly bubbled up if git is missing. Version bump to 0.9.11.

Updated Branches:
  refs/heads/master 9c580c522 -> 4cf02436a


Updated readme with a requirements section. Resolved [CB-4375]: error msgs get properly bubbled up if git is missing. Version bump to 0.9.11.


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

Branch: refs/heads/master
Commit: 4cf02436ade4858cf98926fb2a65d56a69338d9f
Parents: 9c580c5
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Jul 24 15:07:07 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Jul 24 15:07:07 2013 -0700

----------------------------------------------------------------------
 README.md            |  4 ++++
 package.json         |  2 +-
 spec/install.spec.js | 10 +++++++++-
 src/install.js       |  3 ++-
 src/util/plugins.js  |  2 +-
 5 files changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4cf02436/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 5f366e4..077ad72 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,10 @@ A command line tool to install and uninstall plugins for use with [Apache Cordov
 
 This document defines tool usage.
 
+## Requirements
+
+You must have `git` on your PATH to be able to install plugins directly from remote git URLs.
+
 ## Plugin Specification
 
 --&gt; [plugin_spec.md](plugin_spec.md) &lt;--

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4cf02436/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 5a6e55f..c994d6d 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
   "author": "Andrew Lunny <al...@gmail.com>",
   "name": "plugman",
   "description": "install/uninstall Cordova plugins",
-  "version": "0.9.10",
+  "version": "0.9.11",
   "repository": {
     "type": "git",
     "url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4cf02436/spec/install.spec.js
----------------------------------------------------------------------
diff --git a/spec/install.spec.js b/spec/install.spec.js
index c48db9a..f3f2e51 100644
--- a/spec/install.spec.js
+++ b/spec/install.spec.js
@@ -17,11 +17,12 @@ var install = require('../src/install'),
     plugins_dir = path.join(temp, 'plugins');
 
 describe('install', function() {
-    var exists, get_json, chmod, exec, proc, add_to_queue, prepare, actions_push, c_a;
+    var exists, get_json, chmod, exec, proc, add_to_queue, prepare, actions_push, c_a, mkdir;
     beforeEach(function() {
         proc = spyOn(actions.prototype, 'process').andCallFake(function(platform, proj, cb) {
             cb();
         });
+        mkdir = spyOn(shell, 'mkdir');
         actions_push = spyOn(actions.prototype, 'push');
         c_a = spyOn(actions.prototype, 'createAction');
         prepare = spyOn(plugman, 'prepare');
@@ -127,5 +128,12 @@ describe('install', function() {
                 install('android', temp, variableplugin, plugins_dir, {});
             }).toThrow('Variable(s) missing: API_KEY');
         });
+        it('should throw if git is not found on the path and a remote url is requested', function() {
+            exists.andReturn(false);
+            var which_spy = spyOn(shell, 'which').andReturn(null);
+            expect(function() {
+                install('android', temp, 'https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git', plugins_dir, {});
+            }).toThrow('"git" command line tool is not installed: make sure it is accessible on your PATH.');
+        });
     });
 });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4cf02436/src/install.js
----------------------------------------------------------------------
diff --git a/src/install.js b/src/install.js
index fd0f9de..5b818ab 100644
--- a/src/install.js
+++ b/src/install.js
@@ -53,7 +53,8 @@ function possiblyFetch(actions, platform, project_dir, id, plugins_dir, options,
         // if plugin doesnt exist, use fetch to get it.
         require('../plugman').fetch(id, plugins_dir, { link: false, subdir: options.subdir, git_ref: options.git_ref }, function(err, plugin_dir) {
             if (err) {
-                callback(err);
+                if (callback) callback(err);
+                else throw err;
             } else {
                 // update ref to plugin_dir after successful fetch, via fetch callback
                 runInstall(actions, platform, project_dir, plugin_dir, plugins_dir, options, callback);

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4cf02436/src/util/plugins.js
----------------------------------------------------------------------
diff --git a/src/util/plugins.js b/src/util/plugins.js
index 7153926..71a6a02 100644
--- a/src/util/plugins.js
+++ b/src/util/plugins.js
@@ -30,7 +30,7 @@ module.exports = {
     // Fetches plugin information from remote server
     clonePluginGitRepo:function(plugin_git_url, plugins_dir, subdir, git_ref, callback) {
         if(!shell.which('git')) {
-            var err = new Error('git command line is not installed');
+            var err = new Error('"git" command line tool is not installed: make sure it is accessible on your PATH.');
             if (callback) return callback(err);
             else throw err;
         }