@@ 3,7 3,6 @@
import os
import sys
import tomllib
-import json
script_dir = os.path.dirname(os.path.realpath(__file__))
@@ 29,7 28,6 @@ def run(scripts, o):
o.write("\n")
for fn, s in section.get("scripts", {}).items():
- pass
o.write("* ")
o.write(fn)
d = s.get("description")
@@ 43,8 41,7 @@ if __name__ == "__main__":
scripts = tomllib.load(f)
try:
- o = open(sys.argv[1], "w")
+ with open(sys.argv[1], "w", encoding="utf-8") as o:
+ run(scripts, o)
except IndexError:
- o = sys.stdout
-
- run(scripts, o)
+ run(scripts, sys.stdout)