2024-10-12 15:19:59 +00:00
|
|
|
function runHook -S -a name force message
|
2024-07-09 01:57:03 +00:00
|
|
|
if type -q "$name"
|
2024-10-12 15:19:59 +00:00
|
|
|
"$name"
|
|
|
|
or exit 1
|
|
|
|
else if $force
|
2024-07-09 01:57:03 +00:00
|
|
|
if test -n "$message"
|
|
|
|
echo "$message"
|
|
|
|
end
|
|
|
|
|
2024-10-12 15:19:59 +00:00
|
|
|
exit 1
|
2024-07-09 01:57:03 +00:00
|
|
|
else
|
|
|
|
return 1
|
|
|
|
end
|
|
|
|
end
|