Skip to content

Commit

Permalink
clean up print out and structure
Browse files Browse the repository at this point in the history
  • Loading branch information
elral committed Apr 20, 2024
1 parent d85770d commit 6720ea9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions copy_fw_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@ def copy_fw_files (source, target, env):
if os.path.exists("./_build/" + custom_device_folder) == False:
os.makedirs("./_build/" + custom_device_folder + "/Community/firmware")
shutil.copytree(custom_device_folder + "/Community", "./_build/" + custom_device_folder + "/Community", dirs_exist_ok=True)
print("Creating Folder and copying community folder")
print("Creating /_build folder")

if fw_file_name[-3:] == "bin":
fw_file_name=fw_file_name[0:-3] + "uf2"

print("Copying community folder")
shutil.copy(fw_file_name, "./_build/" + custom_device_folder + "/Community/firmware")
createCommunityZipFile(source, target, env)

def createCommunityZipFile(source, target, env):
original_folder_path = "./_build/" + custom_device_folder + "/Community"
zip_file_path = './_dist/' + community_project + '_' + firmware_version + '.zip'
new_folder_in_zip = community_folder
print("Creating zip file")
createZIP(original_folder_path, zip_file_path, new_folder_in_zip)

def createZIP(original_folder_path, zip_file_path, new_folder_name):
Expand All @@ -53,5 +52,3 @@ def createZIP(original_folder_path, zip_file_path, new_folder_name):

env.AddPostAction("$BUILD_DIR/${PROGNAME}.hex", copy_fw_files)
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", copy_fw_files)
#env.AddPostAction("checkprogsize", createCommunityZipFile)
#env.AddCustomTarget("create_community_zip", None, createCommunityZipFile)

0 comments on commit 6720ea9

Please sign in to comment.