2023-10-10 22:21:57 +03:00
|
|
|
#!/bin/sh
|
2023-10-11 21:38:34 +03:00
|
|
|
cp -fr ./src/version.h.in ./src/version.h
|
2023-10-10 22:21:57 +03:00
|
|
|
|
|
|
|
HASH=$(git rev-parse HEAD)
|
|
|
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
MESSAGE=$(git show ${GIT_COMMIT_HASH} | head -n 5 | tail -n 1 | sed -e 's/#//g' -e 's/\"//g')
|
2023-12-17 17:29:58 +03:00
|
|
|
DATE=$(git show ${GIT_COMMIT_HASH} --no-patch --format=%cd --date=local)
|
2023-10-11 21:38:34 +03:00
|
|
|
DIRTY=$(git diff-index --quiet HEAD -- || echo dirty)
|
2023-10-10 22:21:57 +03:00
|
|
|
TAG=$(git describe --tags)
|
|
|
|
|
2023-10-11 21:38:34 +03:00
|
|
|
sed -i -e "s#@HASH@#${HASH}#" ./src/version.h
|
|
|
|
sed -i -e "s#@BRANCH@#${BRANCH}#" ./src/version.h
|
|
|
|
sed -i -e "s#@MESSAGE@#${MESSAGE}#" ./src/version.h
|
2023-12-17 17:29:58 +03:00
|
|
|
sed -i -e "s#@DATE@#${DATE}#" ./src/version.h
|
2023-10-11 21:38:34 +03:00
|
|
|
sed -i -e "s#@DIRTY@#${DIRTY}#" ./src/version.h
|
2023-12-17 17:29:58 +03:00
|
|
|
sed -i -e "s#@TAG@#${TAG}#" ./src/version.h
|