18 lines
552 B
Python
18 lines
552 B
Python
# Remove unnecessary files
|
|
|
|
import os
|
|
import shutil
|
|
|
|
def apply(config: dict) -> bool:
|
|
for item in os.listdir("./decompiled/unknown/"):
|
|
item_path = os.path.join("./decompiled/unknown/", item)
|
|
|
|
if os.path.isfile(item_path):
|
|
os.remove(item_path)
|
|
print(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}')
|
|
return True
|