trim redundant code under os specific operations
This commit is contained in:
parent
dac69d1ea5
commit
944c9e8b0c
14
installer.py
14
installer.py
@ -18,22 +18,18 @@ if platform.system() == "Linux":
|
|||||||
print("Operating system detected: Linux")
|
print("Operating system detected: Linux")
|
||||||
os.chdir(homedir + '/.minecraft')
|
os.chdir(homedir + '/.minecraft')
|
||||||
mcfolder = Path.cwd()
|
mcfolder = Path.cwd()
|
||||||
modfolder = homedir + '/.minecraft/mods'
|
modfolder = mcfolder + '/mods'
|
||||||
os.chdir(mcfolder)
|
|
||||||
print("Changed current working directory to '" + str(mcfolder) + "'")
|
|
||||||
time.sleep(2)
|
|
||||||
|
|
||||||
elif platform.system() == "Windows":
|
elif platform.system() == "Windows":
|
||||||
print("Operating system detected: Windows")
|
print("Operating system detected: Windows")
|
||||||
os.chdir("AppData/Roaming/.minecraft/mods")
|
os.chdir("AppData/Roaming/.minecraft/mods")
|
||||||
mcfolder = Path.cwd()
|
mcfolder = Path.cwd()
|
||||||
os.chdir("mods")
|
modfolder = mcfolder + '/mods'
|
||||||
modfolder = Path.cwd
|
|
||||||
os.chdir(mcfolder)
|
|
||||||
print("Changed current working directory to '" + str(mcfolder) + "'")
|
|
||||||
time.sleep(2)
|
|
||||||
|
|
||||||
os.chdir(mcfolder)
|
os.chdir(mcfolder)
|
||||||
|
print("Changed current working directory to '" + str(mcfolder) + "'")
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
# delete previous mods
|
# delete previous mods
|
||||||
# WARN: THIS DOESN'T CURRENTLY BACK UP EXISTING MODS.
|
# WARN: THIS DOESN'T CURRENTLY BACK UP EXISTING MODS.
|
||||||
|
Reference in New Issue
Block a user