Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
Fix tool crashing when plugins folder already exists
Removed unneccessary determine_arch call
  • Loading branch information
Henry1887 authored Apr 25, 2023
1 parent b2a52e2 commit b25af4b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
LICENSE file in the root directory of this source tree.
"""

import contextlib
import sys
import zipfile
import os
Expand Down Expand Up @@ -112,8 +113,8 @@ def download_universaldemosaic():
console.print("DumbRendererDemosaic is already installed!",
style="yellow on black")
return
arch = determine_arch()
os.mkdir("Bepinex/plugins")
with contextlib.suppress(FileExistsError):
os.mkdir("Bepinex/plugins")
if arch in ["mono_64", "mono_86"]:
install_universaldemosaic_9(
"https://github.com/ManlyMarco/UniversalUnityDemosaics/releases/download/v1.5/UniversalUnityDemosaics_BepInEx5_v1.5.zip",
Expand Down Expand Up @@ -311,14 +312,16 @@ def install_TextureReplacer():
download_url("https://attachments.f95zone.to/2023/01/2332348_Texture_Replacer_v1.0.4.1.zip", "Texture_Replacer.zip")
unzip("Texture_Replacer.zip")
os.system("del Texture_Replacer.zip")
os.mkdir("BepInEx/plugins")
with contextlib.suppress(FileExistsError):
os.mkdir("BepInEx/plugins")
shutil.move("Texture_Replacer.dll", "BepInEx/plugins")
os.system("del Texture_Replacer_il2cpp.dll")
elif arch in ["il2cpp_64", "il2cpp_86"]:
download_url("https://attachments.f95zone.to/2023/01/2332348_Texture_Replacer_v1.0.4.1.zip", "Texture_Replacer.zip")
unzip("Texture_Replacer.zip")
os.system("del Texture_Replacer.zip")
os.mkdir("BepInEx/plugins")
with contextlib.suppress(FileExistsError):
os.mkdir("BepInEx/plugins")
shutil.move("Texture_Replacer_il2cpp.dll", "BepInEx/plugins")
os.system("del Texture_Replacer.dll")
else:
Expand Down

0 comments on commit b25af4b

Please sign in to comment.