cnq3/makefiles/create_git_header.sh

9 lines
280 B
Bash
Raw Normal View History

2020-01-06 00:04:16 +00:00
#!/bin/sh
COMMIT="$(git rev-parse HEAD)"
COMMIT_SHORT="$(git rev-parse --short HEAD)"
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
echo "#define GIT_COMMIT \"${COMMIT}\"" > $1
echo "#define GIT_COMMIT_SHORT \"${COMMIT_SHORT}\"" >> $1
echo "#define GIT_BRANCH \"${BRANCH}\"" >> $1