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/11 23:50:19 UTC

[19/43] git commit: Further [CB-4077] work: remove plugin directory for dependent plugins during uninstallation.

Further [CB-4077] work: remove plugin directory for dependent plugins during uninstallation.


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

Branch: refs/heads/plugman-registry
Commit: db8b3d49ccacd9394d3eec6a9c7fa746f15cfd4c
Parents: 611ec4d
Author: Fil Maj <ma...@gmail.com>
Authored: Tue Jul 9 14:27:41 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Jul 10 11:01:28 2013 -0700

----------------------------------------------------------------------
 spec/uninstall.spec.js | 5 ++++-
 src/uninstall.js       | 8 +++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/db8b3d49/spec/uninstall.spec.js
----------------------------------------------------------------------
diff --git a/spec/uninstall.spec.js b/spec/uninstall.spec.js
index aca4e7c..738e941 100644
--- a/spec/uninstall.spec.js
+++ b/spec/uninstall.spec.js
@@ -51,7 +51,10 @@ describe('uninstallPlatform', function() {
         });
 
         describe('with dependencies', function() {
-            it('should uninstall "dangling" dependencies');
+            it('should uninstall "dangling" dependencies', function() {
+            });
+            it('should remove dangling dependent directories', function() {
+            });
             it('should not uninstall any dependencies that are relied on by other plugins');
         });
     });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/db8b3d49/src/uninstall.js
----------------------------------------------------------------------
diff --git a/src/uninstall.js b/src/uninstall.js
index 6d59e84..0f07774 100644
--- a/src/uninstall.js
+++ b/src/uninstall.js
@@ -93,7 +93,13 @@ function runUninstall(actions, platform, project_dir, plugin_dir, plugins_dir, o
                 cli_variables: options.cli_variables,
                 is_top_level: false /* TODO: should this "is_top_level" param be false for dependents? */
             };
-            runUninstall(actions, platform, project_dir, dependent_path, plugins_dir, opts, end);
+            runUninstall(actions, platform, project_dir, dependent_path, plugins_dir, opts, function(err) {
+                if (err) {
+                    if (callback) return callback(err);
+                    else throw err;
+                }
+                module.exports.uninstallPlugin(dangler, plugins_dir, end);
+            });
         });
     } else {
         // this plugin can get axed by itself, gogo!