From a4545bed16446ea8818f4c6ce57c3a288291fc95 Mon Sep 17 00:00:00 2001 From: Obie Hinojosa Date: Wed, 30 Oct 2024 21:08:00 -0700 Subject: [PATCH] trim redundant code under os specific operations --- installer.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/installer.py b/installer.py index c23846b..bce0a5e 100644 --- a/installer.py +++ b/installer.py @@ -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.