Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
7.0.1
-
None
-
Windows
Description
Hello
I push a sample git project hosting a dummy cordova plugin to reproduce the issue, feel free to clone : https://bitbucket.org/guirip/cordova-plugin-hook-bug
In this plugin I declared 4 hooks :
- before_plugin_add
- after_plugin_add
- before_plugin_rm
- after_plugin_rm
The node script executed by the hooks simply logs the hook name.
- Add, then remove the plugin, you will see that only half the hooks are executed.
> cordova plugin add ....\cordova-plugin-hook-bug --nofetch -d
Creating a new cordova project.
No scripts found for hook "before_plugin_add".
Calling plugman.fetch on plugin "....\cordova-plugin-hook-bug"
Copying plugin "....\cordova-plugin-hook-bug" => "C:\Users\Guillaume\test\testapp\plugins\cordova-plugin-hook-bug"
Adding cordova-plugin-hook-bug to package.json
Saved plugin info for "cordova-plugin-hook-bug" to config.xml
Executing script found in plugin cordova-plugin-hook-bug for hook "after_plugin_add": plugins\cordova-plugin-hook-bug\testhook.js
Hook executed: after_plugin_add
before_plugin_add hook should be executed ?
- Then remove the plugin:
> cordova plugin rm cordova-plugin-hook-bug
Hook executed: before_plugin_rm
Removing "cordova-plugin-hook-bug"
Removing plugin cordova-plugin-hook-bug from config.xml file...
Removing cordova-plugin-hook-bug from package.json
after_plugin_rm hook should be executed ?