编译前删除上次生成的中间文件和固件

This commit is contained in:
2024-12-18 11:15:22 +08:00
parent 71cadfda29
commit 9fb3296d5c

View File

@@ -5,12 +5,19 @@
import os import os
import sys import sys
import time import time
import shutil
if __name__ == "__main__": if __name__ == "__main__":
time_start=time.time() time_start=time.time()
cmd=f"{' '.join(sys.argv[1:])} > build_log.log" if(len(sys.argv)>2):
cmd=f"{' '.join(sys.argv[1:])} > build_log.log"
os.system("python3 ../clear_output.py > /dev/null")
path="../tools/gen_img/customer"
if os.path.exists(path):
shutil.rmtree(path)
else:
cmd=' '.join(sys.argv[1:])
print(cmd) print(cmd)
os.system("python3 ../clear_output.py")
os.system(cmd) os.system(cmd)
time_end=time.time() time_end=time.time()
print(f"build end, cost {time_end-time_start} s") print(f"build end, cost {time_end-time_start} s")