From 6729703827a315fb7c91b360e4c5f77d90b949c8 Mon Sep 17 00:00:00 2001 From: piair Date: Fri, 26 Apr 2024 15:35:37 +0200 Subject: [PATCH] auto update hooks --- hooks/bump.sh | 12 ++++++++++++ hooks/pre-commit | 1 + 2 files changed, 13 insertions(+) create mode 100644 hooks/bump.sh create mode 100644 hooks/pre-commit diff --git a/hooks/bump.sh b/hooks/bump.sh new file mode 100644 index 0000000..22fa406 --- /dev/null +++ b/hooks/bump.sh @@ -0,0 +1,12 @@ +file=version + +if [ "$(git diff HEAD version | wc -w)" -eq 0 ] +then + echo 'updating minor version' + new_path=$(cat $file | awk -F . '{print $1"."$2"."$3+1 }') + echo $new_path > $file + git add version +else + echo 'Version have been updated manually' +fi +echo Version: $(cat $file) \ No newline at end of file diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100644 index 0000000..ca6bf90 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1 @@ +sh hooks/bump.sh