subscript_template/main.py

31 lines
677 B
Python
Raw Normal View History

2024-07-18 10:08:24 +00:00
import os
import json
from subscription import get_subscription, version
targetFile = "dist/%s.json" % version
def main():
print(
"""
------------------------------------------------------
\tGenerating subscription.json
------------------------------------------------------
"""
)
os.makedirs(os.path.dirname(targetFile), exist_ok=True)
with open(targetFile, "w", encoding="utf-8") as f:
json.dump(get_subscription(), f, ensure_ascii=False, indent=4)
print(
"""
------------------------------------------------------
\tDone
------------------------------------------------------
"""
)
if __name__ == "__main__":
main()