Export only str and bool for build configs

This commit is contained in:
Mikhail f. Shiryaev 2024-03-04 20:01:26 +01:00
parent 4bdafed801
commit bd2b0b4338
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -264,6 +264,8 @@ class BuildConfig:
def process(field_name: str, field: Union[bool, str]) -> str:
if isinstance(field, bool):
field = str(field).lower()
elif not isinstance(field, str):
field = ""
if export:
return f"export BUILD_{field_name.upper()}={repr(field)}"
return f"BUILD_{field_name.upper()}={field}"