Skip to content

Commit d47f924

Browse files
authored
remove generated old sdkconfig leftover
1 parent 7da09cf commit d47f924

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

builder/frameworks/arduino.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import os
2929
import sys
3030
import shutil
31-
from os.path import join
31+
from os.path import join, exists
3232

3333
from SCons.Script import COMMAND_LINE_TARGETS, DefaultEnvironment, SConscript
3434
from platformio import fs
@@ -240,6 +240,11 @@ def call_compile_libs():
240240
SConscript("espidf.py")
241241

242242
if check_reinstall_frwrk() == True:
243+
envs = [section.replace("env:", "") for section in config.sections() if section.startswith("env:")]
244+
for env_name in envs:
245+
file_path = join(env.subst("$PROJECT_DIR"), f"sdkconfig.{env_name}")
246+
if exists(file_path):
247+
os.remove(file_path)
243248
print("*** Reinstall Arduino framework ***")
244249
shutil.rmtree(platform.get_package_dir("framework-arduinoespressif32"))
245250
shutil.rmtree(platform.get_package_dir("framework-arduinoespressif32-libs"))

0 commit comments

Comments
 (0)