Skip to content

Commit

Permalink
Expand path to tinuf2 image when checking existence in platformio-bui…
Browse files Browse the repository at this point in the history
…ld.py (#7631)

* Expand path to tinuf2 image when checking existence

* More isFiles fixed
  • Loading branch information
scheffield authored and me-no-dev committed Feb 7, 2023
1 parent d0c014c commit dfd3412
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)

Expand All @@ -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,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit dfd3412

Please sign in to comment.