summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Zuther <code@mzuther.de>2019-12-29 12:51:29 +0100
committerMartin Zuther <code@mzuther.de>2019-12-29 12:51:29 +0100
commitbd19e31c6e6db08b7b8c6d652af3c2e0ee896c1a (patch)
tree3d7466876507b53168d82de0134bc469710a32bd
parent3c204119fb93956a6a9a68e36a653e41f44b6cec (diff)
get rid of dirname
-rwxr-xr-xcontrib/hooks/post_encrypt6
-rwxr-xr-xcontrib/hooks/post_status6
-rwxr-xr-xyadm2
3 files changed, 6 insertions, 8 deletions
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 <https://www.gnu.org/licenses/>.
-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 <https://www.gnu.org/licenses/>.
-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