Support for modman remove shell commands
twslade opened this issue · 2 comments
I think it would be very useful to have the ability to specify shell commands, within the modman file, that get run 'after' a module has been removed.
Using the shell command and magerun would give the ability to 'roll back' quickly when testing install scripts and writing enhancements for modules without the need to start with a fresh database and/or manually altering the database.
Something like this would be in the modman file:
@shell-remove n98-magerun.phar db:query "delete from cms_page where identifier = 'hello-world';"
@shell-remove n98-magerun.phar db:query "delete from core_resource where code = 'namespace_module_setup';"
Thanks for the idea. My take is that automatic uninstall scripts are dangerous. Also, in this case it assumes the presence of n98-magerun.phar which might otherwise not be a dependency. In my opinion the user could simply put these commands in a script named uninstall.sh and then modman would no longer be a dependency and the user could choose to do or skip an uninstall whenever they wanted.
Thanks for the response. I was simply showing an example where you could leverage magerun to do powerful things when uninstalling a module. Other things might be done like cleaning up symlinks, compiling grunt, etc. I still think the feature could be really useful to automate some cleanup when uninstalling a module.