1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00

allow setting custom flipper name

serial & ble mac generated from custom name (if set), CI support added too
This commit is contained in:
MX
2022-08-14 05:34:54 +03:00
parent 4dab3a83a3
commit a896aa4113
7 changed files with 81 additions and 12 deletions

View File

@@ -37,13 +37,28 @@ class GitVersion:
or "unknown"
)
return {
"GIT_COMMIT": commit,
"GIT_BRANCH": branch,
"GIT_BRANCH_NUM": branch_num,
"VERSION": version,
"BUILD_DIRTY": dirty and 1 or 0,
}
custom_fz_name = (
os.environ.get("CUSTOM_FLIPPER_NAME", None)
or ""
)
if (custom_fz_name != "") and (len(custom_fz_name) <= 8):
return {
"GIT_COMMIT": commit,
"GIT_BRANCH": branch,
"GIT_BRANCH_NUM": branch_num,
"FURI_CUSTOM_FLIPPER_NAME": custom_fz_name,
"VERSION": version,
"BUILD_DIRTY": dirty and 1 or 0,
}
else:
return {
"GIT_COMMIT": commit,
"GIT_BRANCH": branch,
"GIT_BRANCH_NUM": branch_num,
"VERSION": version,
"BUILD_DIRTY": dirty and 1 or 0,
}
def _exec_git(self, args):
cmd = ["git"]