kiss: simplify run_hook. Remove hardcoded argument count
This commit is contained in:
parent
cd242f6d23
commit
a024ef4663
13
kiss
13
kiss
|
@ -110,20 +110,13 @@ pkg_owner() {
|
||||||
run_hook() {
|
run_hook() {
|
||||||
# Run all hooks in KISS_HOOK (a colon separated
|
# Run all hooks in KISS_HOOK (a colon separated
|
||||||
# list of absolute file paths).
|
# list of absolute file paths).
|
||||||
_type=${1:-null} _name=${2:-null} _path=${3:-null}
|
|
||||||
|
|
||||||
IFS=:
|
IFS=:
|
||||||
|
|
||||||
# Intentional, globbing disabled.
|
for hook in ${KISS_HOOK:-}; do case $hook in *?*)
|
||||||
# shellcheck disable=2086
|
"$hook" "$@" || die "$1 hook failed: '$hook'"
|
||||||
set -- ${KISS_HOOK:-}
|
esac done
|
||||||
|
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
for hook do case $hook in *?*)
|
|
||||||
"$hook" "$_type" "$_name" "$_path" ||
|
|
||||||
die "$_name" "$_type hook failed: '$hook'"
|
|
||||||
esac done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run_hook_pkg() {
|
run_hook_pkg() {
|
||||||
|
|
Loading…
Reference in New Issue