1
0
Fork 0
mirror of synced 2024-11-04 17:08:56 -05:00

Create YADM_HOOKS variable for hooks dir

This commit is contained in:
Tim Byrne 2019-08-06 08:19:01 -05:00
parent bd71ec8932
commit f0ad40376d
No known key found for this signature in database
GPG key ID: 14DB4FC2465A4B12

4
yadm
View file

@ -30,6 +30,7 @@ YADM_CONFIG="config"
YADM_ENCRYPT="encrypt"
YADM_ARCHIVE="files.gpg"
YADM_BOOTSTRAP="bootstrap"
YADM_HOOKS="hooks"
HOOK_COMMAND=""
FULL_COMMAND=""
@ -789,6 +790,7 @@ function configure_paths() {
YADM_ENCRYPT="$YADM_DIR/$YADM_ENCRYPT"
YADM_ARCHIVE="$YADM_DIR/$YADM_ARCHIVE"
YADM_BOOTSTRAP="$YADM_DIR/$YADM_BOOTSTRAP"
YADM_HOOKS="$YADM_DIR/$YADM_HOOKS"
# independent overrides for paths
if [ -n "$YADM_OVERRIDE_REPO" ]; then
@ -879,7 +881,7 @@ function invoke_hook() {
mode="$1"
exit_status="$2"
hook_command="$YADM_DIR/hooks/${mode}_$HOOK_COMMAND"
hook_command="${YADM_HOOKS}/${mode}_$HOOK_COMMAND"
if [ -x "$hook_command" ] ; then
debug "Invoking hook: $hook_command"