From c9f5e81577033bd521194f0e776965bf15157b61 Mon Sep 17 00:00:00 2001 From: Ewoud Date: Mon, 15 Apr 2024 11:17:02 +0200 Subject: [PATCH] post build github bug fix --- tools/post_build.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/post_build.py b/tools/post_build.py index a10fb121..fe9e356e 100644 --- a/tools/post_build.py +++ b/tools/post_build.py @@ -49,11 +49,14 @@ def bin_rename_copy(source, target, env): pioenv = env["PIOENV"] if isGitHub: - _create_dirs("release") - - # create string with location and file names based on pioenv - map_file = "{}{}_{}_{}.map".format(OUTPUT_DIR, app, version, pioenv) - bin_file = "{}{}_{}_{}.bin".format(OUTPUT_DIR, app, version, pioenv) + _create_dirs() #creates firmware and map + _create_dirs(["release"]) + # create string with location and file names based on pioenv + map_file = "{}map{}{}_{}_{}.map".format(OUTPUT_DIR, os.path.sep, app, version, pioenv) + bin_file = "{}release{}{}_{}_{}.bin".format(OUTPUT_DIR, os.path.sep, app, version, pioenv) + else: + map_file = "{}{}_{}_{}.map".format(OUTPUT_DIR, app, version, pioenv) + bin_file = "{}{}_{}_{}.bin".format(OUTPUT_DIR, app, version, pioenv) # check if new target files exist and remove if necessary for f in [map_file, bin_file]: @@ -70,7 +73,7 @@ def bin_rename_copy(source, target, env): # github needs zips (I think) if isGitHub: - gzip_file = "{}{}_{}_{}.bin.gz".format(OUTPUT_DIR, app, version, pioenv) + gzip_file = "{}release{}{}_{}_{}.bin.gz".format(OUTPUT_DIR, os.path.sep, app, version, pioenv) # check if new target files exist and remove if necessary if os.path.isfile(gzip_file): os.remove(gzip_file)