adding a post-update hook example
This commit is contained in:
parent
b97b438c52
commit
23bc69b8c7
15
hooks/local/post-update
Normal file
15
hooks/local/post-update
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
GIT_TAG=$(git tag --points-at HEAD)
|
||||
if [ -n "$GIT_TAG" ]; then
|
||||
sed -i "/^GIT_TAG=\".*\"/ s//GIT_TAG=\"${GIT_TAG}\"/" .env
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user