1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 06:40:05 +08:00
SpaceVim/bundle/plenary.nvim/scripts/update_vararg.py
2022-05-16 22:20:10 +08:00

16 lines
502 B
Python
Vendored

#!/usr/bin/env python3
import os
import subprocess
def generate_file(name, outpath, **kwargs):
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('./vararg'))
template = env.get_template(name)
path = os.path.join(outpath, name)
with open(path, 'w') as fp:
fp.write(template.render(kwargs))
subprocess.run(["lua-format", "-i", path])
if __name__ == '__main__':
generate_file('rotate.lua', '../lua/plenary/vararg', amount=16)