fix github actions copy error

in some cases the folder already exists. Do not abort copy.
This commit is contained in:
Jason2866 2024-10-28 14:00:00 +01:00 committed by GitHub
parent 104fec83fb
commit ef3c061ecf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -54,19 +54,19 @@ build_flags = ''.join([element.replace("-D", " ") for element in env.GetProjectO
if ("CORE32SOLO1" in extra_flags or "FRAMEWORK_ARDUINO_SOLO1" in build_flags) and flag_custom_sdkconfig == False: if ("CORE32SOLO1" in extra_flags or "FRAMEWORK_ARDUINO_SOLO1" in build_flags) and flag_custom_sdkconfig == False:
FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-solo1") FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-solo1")
if github_actions and os.path.exists("./firmware/firmware"): if github_actions and os.path.exists("./firmware/firmware"):
shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-solo1/variants/tasmota") shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-solo1/variants/tasmota", dirs_exist_ok=True)
if variants_dir: if variants_dir:
shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True) shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True)
elif ("CORE32ITEAD" in extra_flags or "FRAMEWORK_ARDUINO_ITEAD" in build_flags) and flag_custom_sdkconfig == False: elif ("CORE32ITEAD" in extra_flags or "FRAMEWORK_ARDUINO_ITEAD" in build_flags) and flag_custom_sdkconfig == False:
FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-ITEAD") FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-ITEAD")
if github_actions and os.path.exists("./firmware/firmware"): if github_actions and os.path.exists("./firmware/firmware"):
shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-ITEAD/variants/tasmota") shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-ITEAD/variants/tasmota", dirs_exist_ok=True)
if variants_dir: if variants_dir:
shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True) shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True)
else: else:
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
if github_actions and os.path.exists("./firmware/firmware"): if github_actions and os.path.exists("./firmware/firmware"):
shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduinoespressif32/variants/tasmota") shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduinoespressif32/variants/tasmota", dirs_exist_ok=True)
if variants_dir: if variants_dir:
shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True) shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True)