Include git commit hash in ThingSet data objects

This commit is contained in:
Martin Jaeger
2019-08-08 11:19:29 +02:00
parent c968a6bb8a
commit 4b545fa882
4 changed files with 27 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
# Custom script to generate src/version.h file containing the git commit hash
#
# See also http://docs.platformio.org/en/latest/projectconf.html#extra-script
#
import subprocess
try:
commit_hash = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip()
except:
commit_hash = ""
f = open("src/version.h","w+")
f.write("/* Auto-generated file with git commit hash to be included by C code\n")
f.write(" * Do not change this file manually!\n")
f.write(" */\n")
f.write("\n")
f.write('#define COMMIT_HASH "' + commit_hash + '"\n')
f.close