updated git hooks

This commit is contained in:
Brian 2022-06-22 10:47:12 -06:00
parent 0908b601ce
commit 938e1f8c96
Signed by: brian
GPG Key ID: DE1A5390A3B84CD8
3 changed files with 31 additions and 1 deletions

View File

@ -1,5 +1,15 @@
#!/usr/bin/env bash
SHORT_HASH=$(git rev-parse --short HEAD)
sed -i "/^GIT_HASH=\".*\"/ s//GIT_HASH=\"${SHORT_HASH}\"/" .env
DIRTY_STATE=$(git diff --stat)
if [ -n "$DIRTY_STATE" ]; then
sed -i "/^GIT_DIRTY_STATE=.*/ s//GIT_TAG=true/" .env
else
sed -i "/^GIT_DIRTY_STATE=.*/ s//GIT_TAG=false/" .env
fi
GIT_TAG=$(git tag --points-at HEAD)
if [ -n "$GIT_TAG" ]; then
sed -i "/^GIT_TAG=\".*\"/ s//GIT_TAG=\"${GIT_TAG}\"/" .env

View File

@ -1,4 +1,14 @@
#!/usr/bin/env bash
SHORT_HASH=$(git rev-parse --short HEAD)
sed -i "/^GIT_HASH=\".*\"/ s//GIT_HASH=\"${SHORT_HASH}\"/" .env
DIRTY_STATE=$(git diff --stat)
if [ -n "$DIRTY_STATE" ]; then
sed -i "/^GIT_DIRTY_STATE=.*/ s//GIT_TAG=true/" .env
else
sed -i "/^GIT_DIRTY_STATE=.*/ s//GIT_TAG=false/" .env
fi
SHORT_HASH=$(git rev-parse --short HEAD)
sed -i "/^GIT_HASH=\".*\"/ s//GIT_HASH=\"${SHORT_HASH}\"/" .env

View File

@ -1,4 +1,14 @@
#!/usr/bin/env bash
SHORT_HASH=$(git rev-parse --short HEAD)
sed -i "/^GIT_HASH=\".*\"/ s//GIT_HASH=\"${SHORT_HASH}\"/" .env
DIRTY_STATE=$(git diff --stat)
if [ -n "$DIRTY_STATE" ]; then
sed -i "/^GIT_DIRTY_STATE=.*/ s//GIT_TAG=true/" .env
else
sed -i "/^GIT_DIRTY_STATE=.*/ s//GIT_TAG=false/" .env
fi
GIT_TAG=$(git tag --points-at HEAD)
if [ -n "$GIT_TAG" ]; then