Corrected various JSON read and write issues; modpack install is now created, but folder contents appear to be overridden on launch...
This commit is contained in:
parent
f8b29945e1
commit
c954f45715
@ -63,7 +63,7 @@ def main(modpack_path):
|
|||||||
logging.info(f"Modpack {modpack_name} ({modpack_id}) not found in install list - creating...")
|
logging.info(f"Modpack {modpack_name} ({modpack_id}) not found in install list - creating...")
|
||||||
install_list[modpack_id] = {
|
install_list[modpack_id] = {
|
||||||
'created': datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z',
|
'created': datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z',
|
||||||
'gameDir': install_path,
|
'gameDir': str(install_path),
|
||||||
'icon': 'Redstone_Block',
|
'icon': 'Redstone_Block',
|
||||||
'javaArgs': '-Xmx4G '
|
'javaArgs': '-Xmx4G '
|
||||||
'-XX:+UnlockExperimentalVMOptions '
|
'-XX:+UnlockExperimentalVMOptions '
|
||||||
@ -80,7 +80,7 @@ def main(modpack_path):
|
|||||||
full_profile_setup = json.load(f)
|
full_profile_setup = json.load(f)
|
||||||
with open(get_minecraft_folder(sys_root) / 'launcher_profiles.json', 'w') as f:
|
with open(get_minecraft_folder(sys_root) / 'launcher_profiles.json', 'w') as f:
|
||||||
full_profile_setup['profiles'] = install_list
|
full_profile_setup['profiles'] = install_list
|
||||||
json.dump(full_profile_setup, f)
|
json.dump(full_profile_setup, f, indent=2)
|
||||||
logging.info(f"Successfully added mod to installed profile list.")
|
logging.info(f"Successfully added mod to installed profile list.")
|
||||||
|
|
||||||
# Validate file structure compared to mod zip
|
# Validate file structure compared to mod zip
|
||||||
@ -92,4 +92,6 @@ def main(modpack_path):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
logging.basicConfig()
|
||||||
|
logging.getLogger().setLevel(logging.DEBUG)
|
||||||
main(PurePath() / 'testing_data' / 'FusterCluck_test.zip')
|
main(PurePath() / 'testing_data' / 'FusterCluck_test.zip')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user