mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 00:25:57 +01:00
0cf3d5b39a
* generateVersion.sh: move cp(1) flags before arguments POSIX and BSD cp(1) don't support flags after arguments e.g., cp: -fr is not a directory * generateVersion.sh: switch to sed(1) -i for better compatibility On BSDs awk is usually The One True Awk thus doesn't support `-i inplace`. awk: unknown option -i ignored awk: can't open file {sub(/@HASH@/,"1234567890abcdef")}1 source line number 1
14 lines
No EOL
537 B
Bash
Executable file
14 lines
No EOL
537 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')
|
|
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#@DIRTY@#${DIRTY}#" ./src/version.h
|
|
sed -i -e "s#@TAG@#${TAG}#" ./src/version.h |