Lots of shit

This commit is contained in:
2025-06-02 10:23:40 +03:00
parent f1b31c5c3e
commit 42b7d798e1
68 changed files with 11580 additions and 516 deletions

48
scripts/gen_version_json.py Executable file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env python3
import sys
import os
import json
BLACKLIST = [
".git",
".gitignore",
"LICENSE",
"README.md",
"scripts",
"apps"
]
def iterate_files(blacklist=None):
base_dir = os.getcwd()
if blacklist is None:
blacklist = set()
for root, dirs, files in os.walk(base_dir):
# Skip blacklisted dirs based on name
dirs[:] = [d for d in dirs if d not in blacklist]
for file in files:
if file not in blacklist:
abs_path = os.path.join(root, file)
rel_path = os.path.relpath(abs_path, base_dir)
yield rel_path # truncated to current dir >:3
def main():
if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} [version]")
return
version = sys.argv[1]
obj = {}
obj["version"] = version
obj["sys_files"] = {}
for file in iterate_files(BLACKLIST):
obj["sys_files"][f"/{
file}"] = f"https://git.mcorangehq.xyz/xomf/slabOS/raw/branch/main/{file}"
pretty_json = json.dumps(obj, indent=2)
print(pretty_json)
if __name__ == "__main__":
main()