From 73764e9311cd4264f2b0d2447faaeca633612a15 Mon Sep 17 00:00:00 2001 From: Hugo Rialan Date: Thu, 13 Jun 2024 17:51:31 +0200 Subject: [PATCH] Improve hooks --- hooks/dataform_compile.sh | 2 +- hooks/dataform_format.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hooks/dataform_compile.sh b/hooks/dataform_compile.sh index a036793..56f7b47 100755 --- a/hooks/dataform_compile.sh +++ b/hooks/dataform_compile.sh @@ -15,7 +15,7 @@ fi dataform install dataform compile -if [[ $? -ne 0 ]]; then +if [ $? -ne 0 ]; then exit 1 else exit 0 diff --git a/hooks/dataform_format.sh b/hooks/dataform_format.sh index 5988135..a9e240f 100755 --- a/hooks/dataform_format.sh +++ b/hooks/dataform_format.sh @@ -14,11 +14,11 @@ fi # Compute hash of all files in the project before and after formatting to detect changes -hash_before_format=$(find . -type f -exec md5sum {} \; | awk '{print $1}' | sort | md5sum | awk '{print $1}') +hash_before_format=$(find ./definitions ./includes -type f -exec md5sum {} \; | awk '{print $1}' | sort | md5sum | awk '{print $1}') dataform format -hash_after_format=$(find . -type f -exec md5sum {} \; | awk '{print $1}' | sort | md5sum | awk '{print $1}') +hash_after_format=$(find ./definitions ./includes -type f -exec md5sum {} \; | awk '{print $1}' | sort | md5sum | awk '{print $1}') if [ "$hash_before_format" != "$hash_after_format" ]; then exit 1