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/12 05:58:34 UTC
[2/5] git commit: [CB-4077] Separate the actions of removing a plugin
from a platform and removing the plugin entirely
[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/15fb3085
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/15fb3085
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/15fb3085
Branch: refs/heads/master
Commit: 15fb30854bc21b5ca8e7d74c3266aac103ea010e
Parents: 8cc97ef
Author: Ian Clelland <ic...@chromium.org>
Authored: Fri Jul 5 10:49:51 2013 -0400
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu Jul 11 20:45:26 2013 -0700
----------------------------------------------------------------------
src/plugin.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/15fb3085/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);