first working (on linux) draft of installer.py

This commit is contained in:
Obie Hinojosa 2024-10-28 12:57:11 -05:00
parent 45cadfa956
commit 22db0ee622
2 changed files with 8 additions and 5 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.log
*.env
test.py
test.py
checklist.md

View File

@ -27,8 +27,7 @@ elif platform.system() == "Darwin":
os.chdir(homedir + '/.minecraft')
mcfolder = Path.cwd()
os.chdir(homedir + '/.minecraft/mods')
modfolder = Path.cwd()
modfolder = homedir + '/.minecraft/mods'
os.chdir(mcfolder)
@ -38,9 +37,10 @@ time.sleep(2)
#begin mod backup and deletion
#DOESN'T CURRENTLY BACK UP EXISTING MODS.
#THIS DOESN'T CURRENTLY BACK UP EXISTING MODS.
try:
shutil.rmtree(modfolder)
print("Cleared previous mods.")
except OSError as e:
print("Error: %s - %s." % (e.filename, e.strerror))
@ -67,4 +67,6 @@ tar_file_path = 'mods.tar.gz'
extract_to = 'mods'
extract_tar_archive(tar_file_path, extract_to)
print("")
print("All Done!")
print("This script will exit and close in ten seconds. :)")
time.sleep(10)