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 *.log
*.env *.env
test.py test.py
checklist.md

View File

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