From 2c779d205927abb242d161da29f9a7b5599a78bc Mon Sep 17 00:00:00 2001 From: zhzluke96 Date: Fri, 13 Sep 2024 22:20:59 +0800 Subject: [PATCH] :bug: fix #155 download script --- scripts/dl_base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/dl_base.py b/scripts/dl_base.py index 4e33357..f7107ac 100644 --- a/scripts/dl_base.py +++ b/scripts/dl_base.py @@ -77,4 +77,8 @@ def check_exist(self) -> bool: return True def gc(self): - os.system(f"rm -rf {self.cache_dir}") + try: + shutil.rmtree(self.cache_dir) + self.logger.info(f"Cache directory {self.cache_dir} deleted successfully.") + except Exception as e: + self.logger.error(f"Failed to delete cache directory {self.cache_dir}: {e}")