-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
712 additions
and
629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import os | ||
from zipfile import ZipFile | ||
|
||
user_path = os.path.expanduser("~") | ||
git_path = user_path + "/Documents/GitHub/fabulously-optimized/" | ||
version_no = "1.18.1" | ||
packwiz_path = git_path + "Packwiz/" + version_no + "/" | ||
pw_exe_path = "..\packwiz.exe" | ||
mods_path = packwiz_path + "mods" | ||
|
||
mod_files = os.listdir(mods_path) | ||
for item in mod_files: | ||
os.remove( os.path.join(mods_path, item)) | ||
|
||
def extract_file(from_zip, from_file, to_path, from_desc, to_desc): | ||
with ZipFile(from_zip, 'r') as zip: | ||
if from_file in zip.namelist(): | ||
zip.extract(from_file, to_path) | ||
print("Copied " + from_desc + " to " + to_desc) | ||
else: | ||
print("Skipped " + from_desc + " copying to " + to_desc + ", didn't exist") | ||
|
||
|
||
os.chdir(packwiz_path) | ||
cf_zip_path = input("Please drag the Curseforge zip file here: ")[3:][:-1] # Because dragging the file adds "& " and double quotes | ||
os.system(pw_exe_path + " curseforge import \"" + cf_zip_path + "\"") | ||
#os.system(pw_exe_path + " remove hydrogen") | ||
#os.system(pw_exe_path + " mr install hydrogen") | ||
os.system(pw_exe_path + " refresh") | ||
|
||
# Copy fresh manifest/modlist to git | ||
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 | ||
os.system(pw_exe_path + " modrinth export") | ||
for pack in os.listdir(packwiz_path): | ||
if pack.endswith('.mrpack'): | ||
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") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.