2015-01-03 23:13:57 +01:00
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
if len(sys.argv) == 3:
|
|
|
|
tag = sys.argv[1]
|
|
|
|
commit = sys.argv[2]
|
|
|
|
command = 'git tag -a {0} {1} -m "{2}"'.format(tag, commit, tag)
|
|
|
|
output = subprocess.check_output(command, shell=True).decode('utf-8')
|
|
|
|
subprocess.call(command, shell=True)
|
|
|
|
subprocess.call('git push --tags', shell=True)
|
|
|
|
else:
|
2015-05-17 11:49:35 +02:00
|
|
|
print('usage: tag.py TAG_NAME COMMIT')
|
2015-01-03 23:13:57 +01:00
|
|
|
sys.exit(1)
|