mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-08-17 09:10:24 +03:00
* add commit date to "hyprctl version" modified: scripts/generateVersion.sh modified: src/debug/HyprCtl.cpp modified: src/version.h.in * Nix: add date to hyprctl --------- Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
17 lines
657 B
Bash
Executable File
17 lines
657 B
Bash
Executable File
#!/bin/sh
|
|
cp -fr ./src/version.h.in ./src/version.h
|
|
|
|
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')
|
|
DATE=$(git show ${GIT_COMMIT_HASH} --no-patch --format=%cd --date=local)
|
|
DIRTY=$(git diff-index --quiet HEAD -- || echo dirty)
|
|
TAG=$(git describe --tags)
|
|
|
|
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
|
|
sed -i -e "s#@DATE@#${DATE}#" ./src/version.h
|
|
sed -i -e "s#@DIRTY@#${DIRTY}#" ./src/version.h
|
|
sed -i -e "s#@TAG@#${TAG}#" ./src/version.h
|