Some initial tweaks to hooks

* No not require `.sh` extension. Hooks can be written in any language.
* Use `[` for the `-x` test
* Clean up debug message and formatting
This commit is contained in:
Tim Byrne 2017-07-03 16:25:03 -05:00
parent df21cd2cb8
commit 880964e2b2
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
1 changed files with 6 additions and 5 deletions

11
yadm
View File

@ -857,14 +857,15 @@ function error_out() {
}
#: ****** Hook handler ******S
function invoke_hook() {
hook_name=$1
if [[ -x "$YADM_DIR/hooks/$hook_name.sh" ]] ; then
debug "invoking hook: $hook_name"
$YADM_DIR/hooks/$hook_name.sh
hook_name="$1"
if [ -x "$YADM_DIR/hooks/$hook_name" ] ; then
debug "Invoking hook: $hook_name"
"$YADM_DIR/hooks/$hook_name"
fi
}
#; ****** Auto Functions ******