kiss: support a system-wide hook directory with easy use.
Hooks installed to /var/db/kiss/hooks can be accessed via their basename. Usage is as follows. $ ls -1 /var/db/kiss/hooks no-docs shell-on-exit $ export KISS_HOOK=no-docs:shell-on-exit:/home/dylan/bin/kiss_hook See #229
This commit is contained in:
parent
7fc6929516
commit
7d256b203c
15
kiss
15
kiss
|
@ -120,9 +120,18 @@ run_hook() {
|
||||||
|
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
for hook do "$hook" "$_type" "$_name" "$_path" ||
|
for hook do case $hook in
|
||||||
die "$_name" "$_type hook failed: '$hook'"
|
*/*)
|
||||||
done
|
# Absolute path to hook.
|
||||||
|
"$hook" "$_type" "$_name" "$_path"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
# Hook in system-wide hook directory (/var/db/kiss/hooks).
|
||||||
|
# Hooks in this directory can be used via their basename.
|
||||||
|
"$sys_db/../hooks/$hook" "$_type" "$_name" "$_path"
|
||||||
|
;;
|
||||||
|
esac || die "$_name" "$_type hook failed: '$hook'"; done
|
||||||
}
|
}
|
||||||
|
|
||||||
run_hook_pkg() {
|
run_hook_pkg() {
|
||||||
|
|
Loading…
Reference in New Issue