Unverified Commit c6a63241 authored by Max Scheffler's avatar Max Scheffler Committed by GitHub

Expand path to tinuf2 image when checking existence in platformio-build.py (#7631)

* Expand path to tinuf2 image when checking existence

* More isFiles fixed
parent 37c81dc2
......@@ -51,19 +51,19 @@ def get_partition_table_csv(variants_dir):
if partitions_name:
# A custom partitions file is selected
if isfile(join(variant_partitions_dir, partitions_name)):
if isfile(env.subst(join(variant_partitions_dir, partitions_name))):
return join(variant_partitions_dir, partitions_name)
return abspath(
join(fwpartitions_dir, partitions_name)
if isfile(join(fwpartitions_dir, partitions_name))
if isfile(env.subst(join(fwpartitions_dir, partitions_name)))
else partitions_name
)
variant_partitions = join(variant_partitions_dir, "partitions.csv")
return (
variant_partitions
if isfile(variant_partitions)
if isfile(env.subst(variant_partitions))
else join(fwpartitions_dir, "default.csv")
)
......@@ -81,7 +81,7 @@ def get_bootloader_image(variants_dir):
return (
variant_bootloader
if isfile(variant_bootloader)
if isfile(env.subst(variant_bootloader))
else generate_bootloader_image(
join(
FRAMEWORK_DIR,
......@@ -126,8 +126,8 @@ def add_tinyuf2_extra_image():
)
# Add the UF2 image only if it exists and it's not already added
if not isfile(tinuf2_image):
print("Warning! The `%s` UF2 bootloader image doesn't exist" % tinuf2_image)
if not isfile(env.subst(tinuf2_image)):
print("Warning! The `%s` UF2 bootloader image doesn't exist" % env.subst(tinuf2_image))
return
if any(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment