mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-31 12:11:56 -07:00
internal: better versioning (#3543)
* better versioning * meson: better versioning * nix: better versioning --------- Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
This commit is contained in:
14
scripts/generateVersion.sh
Executable file
14
scripts/generateVersion.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
cp ./src/version.h.in ./src/version.h -fr
|
||||
|
||||
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')
|
||||
DIRTY=$(git diff-index --quiet HEAD -- || echo \"dirty\")
|
||||
TAG=$(git describe --tags)
|
||||
|
||||
awk -i inplace "{sub(/@HASH@/,\"${HASH}\")}1" ./src/version.h
|
||||
awk -i inplace "{sub(/@BRANCH@/,\"${BRANCH}\")}1" ./src/version.h
|
||||
awk -i inplace "{sub(/@MESSAGE@/,\"${MESSAGE}\")}1" ./src/version.h
|
||||
awk -i inplace "{sub(/@DIRTY@/,\"${DIRTY}\")}1" ./src/version.h
|
||||
awk -i inplace "{sub(/@TAG@/,\"${TAG}\")}1" ./src/version.h
|
Reference in New Issue
Block a user