summaryrefslogtreecommitdiffstats
path: root/printHash.sh
blob: 71f544663f499a25bc7afe7c8863622812d46448 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

> $1

echo -n "#define GIT_SHA1 \"" > $1

if (command -v "git" >/dev/null) then
git rev-parse --short HEAD | tr -d '\n' >> $1
fi

echo "\"" >> $1
echo "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1