summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkg12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/pkg b/bin/pkg
index 31fe509..b6a601d 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -1,6 +1,8 @@
#!/usr/bin/env zsh
# pkg - /home package manager and zsh playground
+typeset -a -U triggers
+
##
## Internal functions for displaying stuff
##
@@ -373,11 +375,17 @@ update_provides () {
for package in *; {
if [[ -d $PDIR/$package ]] {
[[ $2 = 'remove' ]] && rm -r $package
- exec_hook $package 'post-update'
+ triggers+=$package
}
}
}
+apply_triggers () {
+ for package in $triggers; {
+ exec_hook $package 'post-update'
+ }
+}
+
wrap () {
function=$1
arg=$2
@@ -622,3 +630,5 @@ case $1 in
upgrade) wrap pkg_upgrade "$2" "Looking for updates" ;;
*) die "wait, what?\n" ;;
esac
+
+apply_triggers