[CB-4077] Separate the actions of removing a plugin from a platform and 
removing the plugin entirely


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

Branch: refs/heads/CB-4077
Commit: f577c4dd1c7e751b64abc0317eded567882bc1a3
Parents: 6773ecd
Author: Ian Clelland <[email protected]>
Authored: Fri Jul 5 10:49:51 2013 -0400
Committer: Ian Clelland <[email protected]>
Committed: Wed Jul 10 09:44:39 2013 -0400

----------------------------------------------------------------------
 src/plugin.js | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f577c4dd/src/plugin.js
----------------------------------------------------------------------
diff --git a/src/plugin.js b/src/plugin.js
index ca43e35..a280277 100644
--- a/src/plugin.js
+++ b/src/plugin.js
@@ -138,17 +138,17 @@ module.exports = function plugin(command, targets, 
callback) {
                                 else return true;
                             });
 
-                            // Iterate over all the common platforms between 
the plugin
-                            // and the app, and uninstall.
-                            // If this is a web-only plugin with no platform 
tags, this step
-                            // is not needed and we just --remove the plugin 
below.
-                            intersection.forEach(function(platform) {
+                            // Iterate over all installed platforms and 
uninstall.
+                            // If this is a web-only or dependency-only 
plugin, then
+                            // there may be nothing to do here except remove 
the
+                            // reference from the platform's plugin config 
JSON.
+                            platformList.forEach(function(platform) {
                                 var platformRoot = path.join(projectRoot, 
'platforms', platform);
                                 var parser = new 
platforms[platform].parser(platformRoot);
                                 events.emit('log', 'Calling plugman.uninstall 
on plugin "' + target + '" for platform "' + platform + '"');
-                                
plugman.uninstall((platform=='blackberry'?'blackberry10':platform), 
platformRoot, target, path.join(projectRoot, 'plugins'), { www_dir: 
parser.staging_dir() });
+                                
plugman.uninstall.uninstallPlatform((platform=='blackberry'?'blackberry10':platform),
 platformRoot, target, path.join(projectRoot, 'plugins'), { www_dir: 
parser.staging_dir() });
                             });
-                            end();
+                            plugman.uninstall.uninstallPlugin(target, 
path.join(projectRoot, 'plugins'), end);
                         } else {
                             var err = new Error('Plugin "' + target + '" not 
added to project.');
                             if (callback) callback(err);

Reply via email to