File indexing completed on 2025-11-30 09:40:28
0001 import os
0002 import sys
0003 import re
0004
0005
0006
0007
0008 svg_relative_path = "svgs"
0009 current_directory = os.path.dirname(os.path.abspath(sys.argv[0]))
0010 svg_directory = os.path.join(current_directory, svg_relative_path)
0011
0012 if os.path.exists(svg_directory) and os.path.isdir(svg_directory):
0013
0014 file_names = os.listdir(svg_directory)
0015 print("Found SVG directory with " + str(len(file_names)) + " files")
0016
0017
0018 convert = lambda text: int(text) if text.isdigit() else text.lower()
0019 alphanum_key = lambda key: [convert(c) for c in re.split("([0-9]+)", key)]
0020 file_names.sort(key=alphanum_key)
0021
0022
0023 outputFile = os.path.join(current_directory, "config.json")
0024 with open(outputFile, "w") as file:
0025 content = "[" + ", ".join(['"' + f + '"' for f in file_names]) + "]"
0026 file.write(content)
0027 print("Build Complete")
0028 else:
0029 print("Build Error: Directory Not Found")