Skip to content

Commit

Permalink
post build github bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudwijma committed Apr 15, 2024
1 parent d6b75fe commit c9f5e81
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tools/post_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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)

Expand Down

0 comments on commit c9f5e81

Please sign in to comment.