Commit 0cda2c0c authored by fdeitylink's avatar fdeitylink Committed by Pablo Aguiar

packages: support {$pkg}_uninstall events

Emit uninstall events independent of uninstall.fish
parent b27b3b5a
......@@ -120,6 +120,7 @@ Inside this hook, you can access two package-related variables:
Packages can use this hook to clean up custom resources, etc.
> Note: for backwards-compatibility, uninstall hooks will also be run if they are located at `uninstall.fish` in the package root.
> Hooks may also be triggered by listening for the event `{$package}_uninstall` or `uninstall_$package`.
# Make it public
......
......@@ -17,8 +17,11 @@ function omf.packages.remove -a pkg
# Run uninstall hook first.
omf.packages.run_hook $path uninstall
source $path/uninstall.fish 2> /dev/null;
and emit uninstall_$pkg
if test -f $path/uninstall.fish
source $path/uninstall.fish 2> /dev/null
end
emit uninstall_$pkg
emit {$pkg}_uninstall
if command rm -rf $path
omf.bundle.remove "package" $pkg
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment