2024-08-27 20:40:05 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test -z $1 && { echo "usage: hook <cmd_or_jsfunction> [args]"; exit 0; }
|
|
|
|
cmd=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
test -d ~/hook.d/$cmd && {
|
|
|
|
find ~/hook.d/$cmd/ -type f -executable | while read hook; do
|
2024-08-29 17:18:14 +02:00
|
|
|
{ $hook "$@" || true; } | awk '{ gsub(/\/root\/\//,"",$1); $1 = sprintf("%-40s", $1)} 1'
|
2024-08-27 20:40:05 +02:00
|
|
|
done
|
|
|
|
}
|