Musicreater/clean_update.py

23 lines
641 B
Python
Raw Normal View History

import shutil
import os
2023-04-29 13:28:36 +00:00
from rich.console import Console
from rich.progress import track
2023-04-29 13:28:36 +00:00
console = Console()
2023-04-29 13:28:36 +00:00
def main():
with console.status("Find the full path of .egg-info folder"):
egg_info: list = []
for file in os.listdir():
if os.path.isfile(file) and file.endswith(".egg-info"):
egg_info.append(file)
console.print(file)
for file in track(["build", "dist", "logs", *egg_info], description="Deleting files"):
if os.path.isdir(file) and os.access(file, os.W_OK):
shutil.rmtree(file)
2023-04-19 13:45:43 +00:00
2023-04-29 13:28:36 +00:00
if __name__ == "__main__":
main()