Improve the logic in auto-installation; Add auto-remove on the failed files

This commit is contained in:
Timothyxxx
2024-05-10 20:17:40 +08:00
parent e2741c64b0
commit a59d1f92aa

View File

@@ -12,7 +12,7 @@ import psutil
import requests
from tqdm import tqdm
__version__ = "0.1.8"
__version__ = "0.1.9"
MAX_RETRY_TIMES = 10
UBUNTU_ARM_URL = "https://huggingface.co/datasets/xlangai/ubuntu_arm/resolve/main/Ubuntu.zip"
@@ -95,6 +95,7 @@ class VirtualMachineManager:
file.writelines(new_lines)
# Check and clean on the files inside vms_dir, delete the unregistered ones
os.makedirs(vms_dir, exist_ok=True)
vm_names = os.listdir(vms_dir)
for vm_name in vm_names:
# skip the downloaded .zip file