updated lite, added extra check in pyinstaller cleanup

This commit is contained in:
Concedo 2024-04-14 00:22:21 +08:00
parent 2f3597c29a
commit cfbe8cffbd
2 changed files with 522 additions and 177 deletions

File diff suppressed because one or more lines are too long

View file

@ -2744,7 +2744,8 @@ def delete_old_pyinstaller():
if absdirpath!=selfdirpath and (time.time() - os.path.getctime(absdirpath)) > 14400: # remove if older than 4 hours if absdirpath!=selfdirpath and (time.time() - os.path.getctime(absdirpath)) > 14400: # remove if older than 4 hours
kobold_itemcheck1 = os.path.join(absdirpath, 'koboldcpp_default.dll') kobold_itemcheck1 = os.path.join(absdirpath, 'koboldcpp_default.dll')
kobold_itemcheck2 = os.path.join(absdirpath, 'koboldcpp_default.so') kobold_itemcheck2 = os.path.join(absdirpath, 'koboldcpp_default.so')
if os.path.exists(kobold_itemcheck1) or os.path.exists(kobold_itemcheck2): kobold_itemcheck3 = os.path.join(absdirpath, 'klite.embd')
if os.path.exists(kobold_itemcheck1) or os.path.exists(kobold_itemcheck2) or os.path.exists(kobold_itemcheck3):
try: try:
shutil.rmtree(absdirpath) shutil.rmtree(absdirpath)
print(f"Deleted orphaned pyinstaller dir: {absdirpath}") print(f"Deleted orphaned pyinstaller dir: {absdirpath}")