trim redundant code under os specific operations

This commit is contained in:
Obie Hinojosa 2024-10-30 21:08:00 -07:00
parent dac69d1ea5
commit 944c9e8b0c

View File

@ -18,22 +18,18 @@ if platform.system() == "Linux":
print("Operating system detected: Linux")
os.chdir(homedir + '/.minecraft')
mcfolder = Path.cwd()
modfolder = homedir + '/.minecraft/mods'
os.chdir(mcfolder)
print("Changed current working directory to '" + str(mcfolder) + "'")
time.sleep(2)
modfolder = mcfolder + '/mods'
elif platform.system() == "Windows":
print("Operating system detected: Windows")
os.chdir("AppData/Roaming/.minecraft/mods")
mcfolder = Path.cwd()
os.chdir("mods")
modfolder = Path.cwd
os.chdir(mcfolder)
print("Changed current working directory to '" + str(mcfolder) + "'")
time.sleep(2)
modfolder = mcfolder + '/mods'
os.chdir(mcfolder)
os.chdir(mcfolder)
print("Changed current working directory to '" + str(mcfolder) + "'")
time.sleep(2)
# delete previous mods
# WARN: THIS DOESN'T CURRENTLY BACK UP EXISTING MODS.