fix factory file not removed (#18761)

This commit is contained in:
Jason2866 2023-05-31 21:54:59 +02:00 committed by GitHub
parent 87547657ec
commit 10821b7e24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ def bin_map_copy(source, target, env):
# get locations and file names based on variant
map_file = tasmotapiolib.get_final_map_path(env)
bin_file = tasmotapiolib.get_final_bin_path(env)
one_bin_file = bin_file
if env["PIOPLATFORM"] == "espressif32":
factory_tmp = pathlib.Path(firsttarget).with_suffix("")
@ -21,7 +22,7 @@ def bin_map_copy(source, target, env):
one_bin_file = one_bin_tmp.with_suffix(one_bin_tmp.suffix + ".factory.bin")
# check if new target files exist and remove if necessary
for f in [map_file, bin_file]:
for f in [map_file, bin_file, one_bin_file]:
if f.is_file():
f.unlink()