diff --git a/contrib/hooks/post_encrypt b/contrib/hooks/post_encrypt
index eefb666..d77d988 100755
--- a/contrib/hooks/post_encrypt
+++ b/contrib/hooks/post_encrypt
@@ -17,8 +17,8 @@
# along with this program. If not, see .
-YADM_DIRECTORY=$(dirname "$YADM_HOOK_REPO")
-YADM_CHECKSUMS=$YADM_DIRECTORY/files.checksums
+YADM_CHECKSUMS="$YADM_HOOK_DIR/files.checksums"
+WARNING_MESSAGE="No checksums were created"
# unpack exported array; filenames including a newline character (\n)
# are NOT supported
@@ -27,8 +27,6 @@ IFS=$'\n'
YADM_ENCRYPT_INCLUDE_FILES=( $YADM_ENCRYPT_INCLUDE_FILES )
IFS="$OLD_IFS"
-WARNING_MESSAGE="No checksums were created"
-
function get_checksum_command {
# check if "shasum" exists and supports the algorithm (which is
diff --git a/contrib/hooks/post_status b/contrib/hooks/post_status
index aba3ae8..1a308ef 100755
--- a/contrib/hooks/post_status
+++ b/contrib/hooks/post_status
@@ -17,8 +17,8 @@
# along with this program. If not, see .
-YADM_DIRECTORY=$(dirname "$YADM_HOOK_REPO")
-YADM_CHECKSUMS=$YADM_DIRECTORY/files.checksums
+YADM_CHECKSUMS="$YADM_HOOK_DIR/files.checksums"
+WARNING_MESSAGE="Checksums were not verified"
# unpack exported array; filenames including a newline character (\n)
# are NOT supported
@@ -27,8 +27,6 @@ IFS=$'\n'
YADM_ENCRYPT_INCLUDE_FILES=( $YADM_ENCRYPT_INCLUDE_FILES )
IFS="$OLD_IFS"
-WARNING_MESSAGE="Checksums were not verified"
-
function get_checksum_command {
# check if "shasum" exists and supports the algorithm (which is
diff --git a/yadm b/yadm
index 90b2672..312b70a 100755
--- a/yadm
+++ b/yadm
@@ -1573,6 +1573,7 @@ function invoke_hook() {
# expose some internal data to all hooks
YADM_HOOK_COMMAND=$HOOK_COMMAND
+ YADM_HOOK_DIR=$YADM_DIR
YADM_HOOK_EXIT=$exit_status
YADM_HOOK_FULL_COMMAND=$FULL_COMMAND
YADM_HOOK_REPO=$YADM_REPO
@@ -1583,6 +1584,7 @@ function invoke_hook() {
YADM_ENCRYPT_INCLUDE_FILES=$(join_string $'\n' "${ENCRYPT_INCLUDE_FILES[@]}")
export YADM_HOOK_COMMAND
+ export YADM_HOOK_DIR
export YADM_HOOK_EXIT
export YADM_HOOK_FULL_COMMAND
export YADM_HOOK_REPO