Using variable for heading instead

patch-1
Dwi Siswanto 2021-07-20 14:57:07 +07:00
parent 3dfccad5f1
commit 6d315e62b5
1 changed files with 2 additions and 1 deletions

View File

@ -9,8 +9,9 @@ def command(args, start=None, end=None):
return "\n".join(subprocess.run(args, text=True, capture_output=True).stdout.split("\n")[start:end])[:-1] return "\n".join(subprocess.run(args, text=True, capture_output=True).stdout.split("\n")[start:end])[:-1]
def get_top10(): def get_top10():
HEADER = "## Top 10 Contributors\n\n"
TOP10 = command(["cat", "TOP-10.md"]) TOP10 = command(["cat", "TOP-10.md"])
return "## Top 10 Contributors\n\n" + TOP10 if len(TOP10) > 0 else "" return HEADER + TOP10 if len(TOP10) > 0 else ""
if __name__ == "__main__": if __name__ == "__main__":
version = command(["git", "describe", "--tags", "--abbrev=0"]) version = command(["git", "describe", "--tags", "--abbrev=0"])