forked from hhj/subscript_template
31 lines
671 B
Python
31 lines
671 B
Python
import os
|
|
import json
|
|
from subscription import get_subscription, name
|
|
|
|
|
|
targetFile = "dist/%s.json" % name
|
|
|
|
|
|
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()
|