cpu/stm32/kconfig: create family directory if not exist

This commit is contained in:
Alexandre Abadie 2020-10-09 16:26:19 +02:00
parent afd3de2043
commit bd24a71fe0
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -112,9 +112,12 @@ def generate_kconfig(kconfig, context, overwrite, verbose):
template = env.get_template(template_file) template = env.get_template(template_file)
render = template.render(**context) render = template.render(**context)
kconfig_file = os.path.join( kconfig_dir = os.path.join(STM32_KCONFIG_DIR, context["fam"])
STM32_KCONFIG_DIR, context["fam"], "Kconfig.{}".format(kconfig) kconfig_file = os.path.join(kconfig_dir, "Kconfig.{}".format(kconfig))
)
# Create family Kconfig dir if it doesn't exist yet
if not os.path.exists(kconfig_dir):
os.makedirs(kconfig_dir)
if (not os.path.exists(kconfig_file) or if (not os.path.exists(kconfig_file) or
(os.path.exists(kconfig_file) and (os.path.exists(kconfig_file) and