Add getting top 10 function

This commit is contained in:
Dwi Siswanto
2021-07-20 14:50:15 +07:00
parent 2d95c8dbfc
commit 31bae65ed1

View File

@@ -8,6 +8,10 @@ def countTpl(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]
def get_top10():
TOP10 = command(["cat", "TOP-10.md"])
return "## Top 10 Contributors\n\n" + TOP10 if len(TOP10) > 0 else ""
if __name__ == "__main__":
version = command(["git", "describe", "--tags", "--abbrev=0"])
template = eval(open(".github/scripts/README.tmpl", "r").read())