fixing git hook scripts
This commit is contained in:
@ -5,13 +5,10 @@ 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
|
||||
sed -i "/^GIT_DIRTY_STATE=.*/ s//GIT_DIRTY_STATE=true/" .env
|
||||
else
|
||||
sed -i "/^GIT_DIRTY_STATE=.*/ s//GIT_TAG=false/" .env
|
||||
sed -i "/^GIT_DIRTY_STATE=.*/ s//GIT_DIRTY_STATE=false/" .env
|
||||
fi
|
||||
|
||||
SHORT_HASH=$(git rev-parse --short HEAD)
|
||||
sed -i "/^GIT_HASH=\".*\"/ s//GIT_HASH=\"${SHORT_HASH}\"/" .env
|
||||
|
||||
GIT_TAG=$(git tag --points-at HEAD)
|
||||
if [ -n "$GIT_TAG" ]; then
|
||||
@ -19,3 +16,10 @@ if [ -n "$GIT_TAG" ]; then
|
||||
else
|
||||
sed -i "/^GIT_TAG=\".*\"/ s//GIT_TAG=\"\"/" .env
|
||||
fi
|
||||
|
||||
GIT_BRANCH=$(git branch --show-current)
|
||||
if [ -n "$GIT_BRANCH" ]; then
|
||||
sed -i "/^GIT_BRANCH=\".*\"/ s//GIT_BRANCH=\"${GIT_BRANCH}\"/" .env
|
||||
else
|
||||
sed -i "/^GIT_BRANCH=\".*\"/ s//GIT_BRANCH=\"\"/" .env
|
||||
fi
|
||||
|
Reference in New Issue
Block a user