nuclei-templates/.github/scripts/update-readme.py

19 lines
485 B
Python
Raw Normal View History

2020-11-17 18:18:20 +00:00
#!/usr/bin/env python3
import os
import subprocess
def countTpl(path):
return len(os.listdir(path))
def command(args, start=None, end=None):
return "\n".join(subprocess.run(args, text=True, capture_output=True).stdout.split("\n")[start:end])[:-1]
if __name__ == "__main__":
version = command(["git", "describe", "--tags", "--abbrev=0"])
2020-11-17 18:55:17 +00:00
template = eval(open(".github/scripts/README.tmpl", "r").read())
2020-11-17 18:18:20 +00:00
print(template)
f = open("README.md", "w")
2020-11-17 18:26:27 +00:00
f.write(template)
2020-11-17 18:55:17 +00:00
f.close()