Fixed case where no mods folder present.

This commit is contained in:
2024-02-20 23:16:27 -05:00
parent 5b002940f4
commit 8f147f7a2f

View File

@@ -118,7 +118,8 @@ def backup_mods(modpack_dir, mods_backup_dir):
os.remove(source_path) os.remove(source_path)
print(f"Mods backed up to '{mods_backup_dir}'.") print(f"Mods backed up to '{mods_backup_dir}'.")
else: else:
print("No mods directory found. No backup required.") print("No mods directory found. Creating one now.")
os.makedirs(modpack_dir, exist_ok=True)
# Helper function to save the list of mod filenames as a manifest. # Helper function to save the list of mod filenames as a manifest.
def save_modpack_manifest(modpack_dir, mod_filenames): def save_modpack_manifest(modpack_dir, mod_filenames):