Add option --fullyear
This commit is contained in:
parent
c92864febe
commit
5f082698ab
10
tagger
10
tagger
|
@ -1,9 +1,14 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--fullyear", action="store_true")
|
||||
args = ap.parse_args()
|
||||
|
||||
subprocess.run(["git", "pull"])
|
||||
result = subprocess.run(["git", "log", "--pretty=format:%H %D", "--date-order"], stdout=subprocess.PIPE, universal_newlines=True)
|
||||
found_tags = set()
|
||||
|
@ -20,7 +25,10 @@ for ln in result.stdout.split("\n"):
|
|||
print(need_tag, found_tags)
|
||||
if need_tag:
|
||||
today = datetime.date.today()
|
||||
tag = today.strftime("r%y.%m.%d")
|
||||
if args.fullyear:
|
||||
tag = today.strftime("r%Y.%m.%d")
|
||||
else:
|
||||
tag = today.strftime("r%y.%m.%d")
|
||||
if tag in found_tags:
|
||||
inc = 1
|
||||
while f"{tag}.{inc}" in found_tags:
|
||||
|
|
Loading…
Reference in New Issue