You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2013/07/28 02:56:04 UTC

[42/50] git commit: fixing fetch

fixing fetch


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

Branch: refs/heads/master
Commit: 1641fe84133e8e9b0ee3fd9f7fff8ffb776b7642
Parents: 9dab680
Author: Anis Kadri <an...@apache.org>
Authored: Fri Jul 19 14:27:24 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Jul 19 14:27:24 2013 -0700

----------------------------------------------------------------------
 src/fetch.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1641fe84/src/fetch.js
----------------------------------------------------------------------
diff --git a/src/fetch.js b/src/fetch.js
index 7cd4fb2..d5e3e8c 100644
--- a/src/fetch.js
+++ b/src/fetch.js
@@ -82,8 +82,13 @@ module.exports = function fetchPlugin(plugin_dir, plugins_dir, options, callback
         if(!fs.existsSync(plugin_dir)) {
           registry.use(require('../plugman').config.registry, function() {
             registry.fetch([plugin_dir], function(err, plugin_dir) {
-                if (callback) return callback(err);
-                else throw err;
+                if (err) {
+                    if(callback) {
+                        return callback(err);
+                    } else {
+                         throw err;
+                    }
+                }
                 movePlugin(plugin_dir, false);
             });
           })