Simplify the creation of hooks
This commit is contained in:
parent
2de0d9a565
commit
d4fa8f2ebd
2 changed files with 14 additions and 6 deletions
scripts/Common/Scripts
12
scripts/Common/Scripts/hooks.fish
Normal file
12
scripts/Common/Scripts/hooks.fish
Normal file
|
@ -0,0 +1,12 @@
|
|||
function runHook -S -a name message
|
||||
if type -q "$name"
|
||||
if test -n "$message"
|
||||
echo "$message"
|
||||
end
|
||||
|
||||
"$name"
|
||||
or exit
|
||||
else
|
||||
return 1
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue