Fix error if ui-compiler already exists and add message when removing old vanilla folder

This commit is contained in:
drojf
2024-07-26 23:54:52 +10:00
parent c8d918147a
commit ee00947557

View File

@@ -385,6 +385,7 @@ if lastModifiedManager.isRemoteModifiedAndUpdateMemory(assets_url) or force_down
print("Downloading and Extracting Vanilla assets") print("Downloading and Extracting Vanilla assets")
pathlib.Path(vanilla_archive).unlink(missing_ok=True) pathlib.Path(vanilla_archive).unlink(missing_ok=True)
if os.path.exists(vanilla_folder_path): if os.path.exists(vanilla_folder_path):
print("Attempting to remove old vanilla folder...")
shutil.rmtree(vanilla_folder_path) shutil.rmtree(vanilla_folder_path)
download(assets_url) download(assets_url)
@@ -434,6 +435,8 @@ try:
working_cargo = True working_cargo = True
except: except:
print("No working Rust/cargo found - download binary release of UI compiler...") print("No working Rust/cargo found - download binary release of UI compiler...")
if os.path.exists('ui-compiler.exe'):
os.remove('ui-compiler.exe')
download( download(
"https://github.com/07th-mod/ui-editing-scripts/releases/latest/download/ui-compiler.exe" "https://github.com/07th-mod/ui-editing-scripts/releases/latest/download/ui-compiler.exe"
) )