Delete files in folder `berry/generate`

This commit is contained in:
Jason2866 2022-09-10 15:04:00 +02:00 committed by GitHub
parent be544b4a96
commit 7ca8fa94b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,7 @@ Import("env")
env = DefaultEnvironment() env = DefaultEnvironment()
platform = env.PioPlatform() platform = env.PioPlatform()
import os import os
import glob
import subprocess import subprocess
from os.path import join from os.path import join
@ -9,6 +10,13 @@ from os.path import join
CURRENT_DIR = os.getcwd() CURRENT_DIR = os.getcwd()
BERRY_GEN_DIR = join(env.subst("$PROJECT_DIR"), "lib", "libesp32","berry") BERRY_GEN_DIR = join(env.subst("$PROJECT_DIR"), "lib", "libesp32","berry")
os.chdir(BERRY_GEN_DIR) os.chdir(BERRY_GEN_DIR)
fileList = glob.glob(join(BERRY_GEN_DIR, "generate", "*"))
for filePath in fileList:
try:
os.remove(filePath)
# print("Deleting file : ", filePath)
except:
print("Error while deleting file : ", filePath)
cmd = (env["PYTHONEXE"],join("tools","coc","coc"),"-o","generate","src","default",join("..","berry_tasmota","src"),join("..","berry_mapping","src"),join("..","berry_int64","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src"),join("..","..","libesp32_lvgl","lv_binding_berry","generate"),"-c",join("default","berry_conf.h")) cmd = (env["PYTHONEXE"],join("tools","coc","coc"),"-o","generate","src","default",join("..","berry_tasmota","src"),join("..","berry_mapping","src"),join("..","berry_int64","src"),join("..","..","libesp32_lvgl","lv_binding_berry","src"),join("..","..","libesp32_lvgl","lv_binding_berry","generate"),"-c",join("default","berry_conf.h"))
returncode = subprocess.call(cmd, shell=False) returncode = subprocess.call(cmd, shell=False)
os.chdir(CURRENT_DIR) os.chdir(CURRENT_DIR)