Skip to content

Commit

Permalink
Also copy elf file to output directory (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Nov 22, 2024
1 parent e6341fc commit 3d3def3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ def dest_ota_bin(self, file_base: Path) -> Path:
"""Get the destination OTA binary path."""
return file_base / f"{self.name}.ota.bin"

def dest_elf(self, file_base: Path) -> Path:
"""Get the destination ELF path."""
return file_base / f"{self.name}.elf"

def source_factory_bin(self, elf: Path) -> Path:
"""Get the source factory binary path."""
if self.platform == "rp2040":
Expand Down Expand Up @@ -283,12 +287,16 @@ def main(argv) -> int:
source_ota_bin = config.source_ota_bin(elf)
dest_ota_bin = config.dest_ota_bin(file_base)

dest_elf = config.dest_elf(file_base)

file_base.mkdir(parents=True, exist_ok=True)

shutil.copyfile(source_factory_bin, dest_factory_bin)
print("Copied factory binary to:", dest_factory_bin)
shutil.copyfile(source_ota_bin, dest_ota_bin)
print("Copied OTA binary to:", dest_ota_bin)
shutil.copyfile(elf, dest_elf)
print("Copied ELF file to:", dest_elf)

print("::endgroup::")

Expand Down

0 comments on commit 3d3def3

Please sign in to comment.