From 10821b7e2487f9f543c11ae15b9252525ebf7a2b Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Wed, 31 May 2023 21:54:59 +0200 Subject: [PATCH] fix factory file not removed (#18761) --- pio-tools/name-firmware.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pio-tools/name-firmware.py b/pio-tools/name-firmware.py index 0d853d035..e2d38f6fd 100644 --- a/pio-tools/name-firmware.py +++ b/pio-tools/name-firmware.py @@ -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()