From 880964e2b2cd42c304f39da8190622cd749cfc06 Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Mon, 3 Jul 2017 16:25:03 -0500 Subject: [PATCH] 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 --- yadm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/yadm b/yadm index ab06720..ea98655 100755 --- a/yadm +++ b/yadm @@ -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 ******