Compare commits
No commits in common. "5924f217c798292e8ad7ef53ef4f7a80e019cfc3" and "8d5343be0caf4b3f18c6978b9c7011ce4cbbcb82" have entirely different histories.
5924f217c7
...
8d5343be0c
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
*.log
|
|
||||||
*.env
|
|
||||||
test.py
|
|
||||||
checklist.md
|
|
72
installer.py
72
installer.py
@ -1,72 +0,0 @@
|
|||||||
import urllib
|
|
||||||
import urllib.request
|
|
||||||
import tarfile
|
|
||||||
import os
|
|
||||||
import platform
|
|
||||||
import time
|
|
||||||
import shutil
|
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
#detect operating system and find home folder
|
|
||||||
homedir = os.path.expanduser("~")
|
|
||||||
|
|
||||||
#operating system specific operations.
|
|
||||||
#we find the minecraft folder in this section.
|
|
||||||
if platform.system() == "Linux":
|
|
||||||
print("Operating system detected: Linux")
|
|
||||||
|
|
||||||
elif platform.system() == "Windows":
|
|
||||||
print("Operating system detected: Windows")
|
|
||||||
|
|
||||||
elif platform.system() == "Darwin":
|
|
||||||
print("Operating system detected: MacOS")
|
|
||||||
print("fuck you.")
|
|
||||||
#needs function
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#begin mod backup and deletion
|
|
||||||
#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))
|
|
||||||
|
|
||||||
os.mkdir(modfolder)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#begin download and extract
|
|
||||||
#this snippet below defines a tar extract FUNCTION
|
|
||||||
def extract_tar_archive(tar_file_path, extract_to):
|
|
||||||
with tarfile.open(tar_file_path, 'r') as tar:
|
|
||||||
tar.extractall(extract_to)
|
|
||||||
|
|
||||||
print("Starting install...")
|
|
||||||
|
|
||||||
print("Fetching mods...")
|
|
||||||
#this is the SIMPLEST implementation of curl i have ever seen i just NUTTED SO FUCKING HARD
|
|
||||||
url = 'https://git.adolin.xyz/saru/lobotomy-mod-pack/raw/branch/main/mods.tar.gz'
|
|
||||||
urllib.request.urlretrieve(url, 'mods.tar.gz')
|
|
||||||
|
|
||||||
print("Extracting and writing to disk...")
|
|
||||||
|
|
||||||
tar_file_path = 'mods.tar.gz'
|
|
||||||
extract_to = 'mods'
|
|
||||||
extract_tar_archive(tar_file_path, extract_to)
|
|
||||||
|
|
||||||
print("All Done!")
|
|
||||||
print("This script will exit and close in ten seconds. :)")
|
|
||||||
time.sleep(10)
|
|
Reference in New Issue
Block a user