Skip to content

Commit

Permalink
when generating res_fw.qrc, only use compiled firmwares
Browse files Browse the repository at this point in the history
  • Loading branch information
alhirzel committed Nov 6, 2023
1 parent 2f979a3 commit cf90138
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion package_firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,16 @@ def get_git_revision_short_hash() -> str:
for target in package_dict[directory]:
# Shorthand variable
destination_file_name = target[1]
destination_full_path = os.path.join(destination_path, destination_file_name)
origin_file_name = target[0] + '.bin'
origin_full_path = os.path.join(build_dir, target[0], origin_file_name)

# Skip firmware that has not been built
if not os.path.isfile(origin_full_path):
continue

# Copy the file
shutil.copy(os.path.join(build_dir, target[0], origin_file_name), os.path.join(destination_path, destination_file_name))
shutil.copy(origin_full_path, destination_full_path)

# Replace the stub string with the target specifics
target_res_string = res_firmwares_string.replace("TARGET_DESTINATION_DIRECTORY", directory).replace("TARGET_DESTINATION_FILENAME", destination_file_name)
Expand Down

0 comments on commit cf90138

Please sign in to comment.