This commit is contained in:
Willy-JL
2023-02-02 21:38:45 +00:00
parent 651548913e
commit e33023463a
50 changed files with 336 additions and 256 deletions
+14 -11
View File
@@ -11,7 +11,11 @@ from datetime import date, datetime
class GitVersion:
def __init__(self, source_dir):
self.source_dir = source_dir
self.gitlist = [("commit", "rev-parse --short HEAD"), ("branch", "rev-parse --abbrev-ref") , ("branch_num", "rev-list -count HEAD")]
self.gitlist = [
("commit", "rev-parse --short HEAD"),
("branch", "rev-parse --abbrev-ref"),
("branch_num", "rev-list -count HEAD"),
]
def get_version_info(self):
commit = branch = branch_num = "XFW-0040"
@@ -36,20 +40,19 @@ class GitVersion:
# If WORKFLOW_BRANCH_OR_TAG is set in environment, is has precedence
# (set by CI)
custom_fz_name = (
os.environ.get("CUSTOM_FLIPPER_NAME", None)
or ""
)
custom_fz_name = os.environ.get("CUSTOM_FLIPPER_NAME", None) or ""
force_no_dirty = (
os.environ.get("FORCE_NO_DIRTY", None)
or ""
)
force_no_dirty = os.environ.get("FORCE_NO_DIRTY", None) or ""
if (force_no_dirty != ""):
if force_no_dirty != "":
dirty = False
if (custom_fz_name != "") and (len(custom_fz_name) <= 8) and (custom_fz_name.isalnum()) and (custom_fz_name.isascii()):
if (
(custom_fz_name != "")
and (len(custom_fz_name) <= 8)
and (custom_fz_name.isalnum())
and (custom_fz_name.isascii())
):
return {
"GIT_COMMIT": commit,
"GIT_BRANCH": "dev",