forked from anixart-mod/patcher
Добавление патча сжатия png, обновление документации
This commit is contained in:
+5
-3
@@ -1,4 +1,6 @@
|
||||
# Remove unnecessary files
|
||||
"""Remove unnecessary files"""
|
||||
priority = 0
|
||||
from tqdm import tqdm
|
||||
|
||||
import os
|
||||
import shutil
|
||||
@@ -9,9 +11,9 @@ def apply(config: dict) -> bool:
|
||||
|
||||
if os.path.isfile(item_path):
|
||||
os.remove(item_path)
|
||||
print(f'Удалён файл: {item_path}')
|
||||
tqdm.write(f'Удалён файл: {item_path}')
|
||||
elif os.path.isdir(item_path):
|
||||
if item not in config["cleanup"]["keep_dirs"]:
|
||||
shutil.rmtree(item_path)
|
||||
print(f'Удалена папка: {item_path}')
|
||||
tqdm.write(f'Удалена папка: {item_path}')
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user