Skip to content

Instantly share code, notes, and snippets.

@maicol07
Created February 24, 2025 17:29
Show Gist options
  • Save maicol07/4b8b62338e6fd4e97a2a2ac832decb7d to your computer and use it in GitHub Desktop.
Save maicol07/4b8b62338e6fd4e97a2a2ac832decb7d to your computer and use it in GitHub Desktop.
Simple Python script to update loaded JSON mods for the Dragon Ball Sparking Zero Mod Loader
import os
CONFIG = {
'ignored': ['vortex.deployment.dragonballsparkingzero-json.json']
}
# Get current script path
path = os.path.dirname(os.path.realpath(__file__))
# Get all JSON files in the current directory
files = [f for f in os.listdir(path) if f.endswith('.json') and f not in CONFIG['ignored']]
obj = {'Default': [f.removesuffix(".json") for f in files]}
# Write to JsonFiles.json in the script directory
with open(os.path.join(path, 'JsonFiles.json'), 'w') as f:
f.write(str(obj))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment