2024-10-24 16:20:13 +00:00
|
|
|
function runHook -S
|
|
|
|
argparse "force" -- $argv
|
|
|
|
set -l name $argv[1]
|
|
|
|
set -l message $argv[2]
|
|
|
|
|
2024-07-09 01:57:03 +00:00
|
|
|
if type -q "$name"
|
2024-10-12 15:19:59 +00:00
|
|
|
"$name"
|
|
|
|
or exit 1
|
2024-10-24 16:20:13 +00:00
|
|
|
else if [ -n "$_flag_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
|