mirror of
https://github.com/Fabulously-Optimized/fabulously-optimized.git
synced 2024-05-16 05:11:58 +00:00
mmc-export preparations
This commit is contained in:
parent
6c25f758aa
commit
284998b93d
|
@ -4,18 +4,22 @@ from pathlib import Path
|
|||
import toml # pip install toml
|
||||
|
||||
user_path = os.path.expanduser("~")
|
||||
git_path = user_path + "/Documents/GitHub/fabulously-optimized/"
|
||||
git_path = user_path + "\\Documents\\GitHub\\fabulously-optimized\\"
|
||||
minecraft_version = "1.18.2"
|
||||
packwiz_path = git_path + "Packwiz/" + minecraft_version + "/"
|
||||
packwiz_path = git_path + "Packwiz\\" + minecraft_version + "\\"
|
||||
packwiz_exe_path = "..\packwiz.exe"
|
||||
mods_path = packwiz_path + "mods"
|
||||
packwiz_manifest = "pack.toml"
|
||||
|
||||
refresh_only = False
|
||||
cf_zip_path = ""
|
||||
pack_version = ""
|
||||
|
||||
refresh_only = True
|
||||
is_legacy = False
|
||||
hydrogen = False
|
||||
modrinth_overrides = True
|
||||
modrinth_export = False
|
||||
mmc_export_modrinth_export = True
|
||||
packwiz_modrinth_export = False
|
||||
|
||||
def extract_file(from_zip, from_file, to_path, from_desc, to_desc):
|
||||
with ZipFile(from_zip, 'r') as zip:
|
||||
|
@ -31,7 +35,7 @@ if refresh_only == False:
|
|||
os.remove( os.path.join(mods_path, item))
|
||||
|
||||
os.chdir(packwiz_path)
|
||||
if refresh_only == False:
|
||||
if refresh_only == True:
|
||||
cf_zip_path = input("Please drag the CurseForge zip file here: ")[3:][:-1] # Because dragging the file adds "& " and double quotes
|
||||
|
||||
# Update pack.toml first
|
||||
|
@ -57,13 +61,23 @@ if is_legacy == False and refresh_only == False:
|
|||
extract_file(cf_zip_path, "manifest.json", git_path + "CurseForge", "CurseForge manifest.json", "Git")
|
||||
extract_file(cf_zip_path, "modlist.html", git_path + "CurseForge", "CurseForge modlist.html", "Git")
|
||||
|
||||
# Export Modrinth pack and manifest
|
||||
if modrinth_export:
|
||||
|
||||
# Export Modrinth pack and manifest via mmc-export method
|
||||
if mmc_export_modrinth_export:
|
||||
mmc_zip_root = str(Path(cf_zip_path).parents[0])
|
||||
mmc_zip_path = mmc_zip_root + "\\Fabulously Optimized " + pack_version + ".zip"
|
||||
modrinth_config = git_path + "Modrinth\\mmc-export.toml"
|
||||
os.system("mmc-export -i \"" + mmc_zip_path + "\" -f Modrinth --modrinth-search loose -o \"" + mmc_zip_root + "\" -c \"" + modrinth_config + "\" -v " + pack_version)
|
||||
if is_legacy == False:
|
||||
extract_file(mmc_zip_root + "\\MR_Fabulously Optimized.mrpack", "modrinth.index.json", git_path + "\\" + "Modrinth", "Modrinth manifest", "Git")
|
||||
|
||||
# Export Modrinth pack and manifest via packwiz method
|
||||
if packwiz_modrinth_export:
|
||||
os.system(packwiz_exe_path + " modrinth export")
|
||||
for pack in os.listdir(packwiz_path):
|
||||
if pack.endswith('.mrpack'):
|
||||
if is_legacy == False:
|
||||
extract_file(packwiz_path + "/" + pack, "modrinth.index.json", git_path + "/" + "Modrinth", "Modrinth manifest", "Git")
|
||||
os.replace(packwiz_path + "/" + pack, os.path.expanduser("~/Desktop") + "/" + pack)
|
||||
extract_file(packwiz_path + "\\" + pack, "modrinth.index.json", git_path + "\\" + "Modrinth", "Modrinth manifest", "Git")
|
||||
os.replace(packwiz_path + "\\" + pack, os.path.expanduser("~/Desktop") + "\\" + pack)
|
||||
print("Moved " + pack + " to desktop")
|
||||
os.system(packwiz_exe_path + " refresh")
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
name = "Fabulously Optimized"
|
||||
author = "robotkoer"
|
||||
version = "3.8.3-mr.1"
|
||||
description = "Improve your graphics and performance with this simple modpack. Experimental releases on Modrinth!"
|
||||
|
||||
[[Resource]]
|
||||
|
|
Loading…
Reference in a new issue