Added exception handler if the repo was not cloned

This commit is contained in:
Thomas Basler 2022-08-14 14:50:54 +02:00
parent 037f2ee3c2
commit ecfe30a02c

View File

@ -16,7 +16,10 @@ if missing_pkgs:
from dulwich import porcelain from dulwich import porcelain
def get_firmware_specifier_build_flag(): def get_firmware_specifier_build_flag():
build_version = porcelain.describe('.') # '.' refers to the repository root dir try:
build_version = porcelain.describe('.') # '.' refers to the repository root dir
except:
build_version = "g0000000"
build_flag = "-D AUTO_GIT_HASH=\\\"" + build_version + "\\\"" build_flag = "-D AUTO_GIT_HASH=\\\"" + build_version + "\\\""
print ("Firmware Revision: " + build_version) print ("Firmware Revision: " + build_version)
return (build_flag) return (build_flag)