catch error if git repo can't be accessd
This commit is contained in:
parent
40c720aa57
commit
9475a78211
@ -18,9 +18,13 @@ from dulwich import porcelain
|
||||
def get_firmware_specifier_build_flag():
|
||||
try:
|
||||
build_version = porcelain.describe('.') # '.' refers to the repository root dir
|
||||
branch_name = porcelain.active_branch('.').decode('utf-8')
|
||||
except:
|
||||
except Exception as err:
|
||||
print(f"Unexpected {err=}, {type(err)=}")
|
||||
build_version = "g0000000"
|
||||
try:
|
||||
branch_name = porcelain.active_branch('.').decode('utf-8') # '.' refers to the repository root dir
|
||||
except Exception as err:
|
||||
print(f"Unexpected {err=}, {type(err)=}")
|
||||
branch_name = ""
|
||||
build_flag = "-D AUTO_GIT_HASH=\\\"" + build_version + "\\\" "
|
||||
build_flag += "-D AUTO_GIT_BRANCH=\\\"" + branch_name + "\\\""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user