diff options
| author | 2016-11-15 14:18:53 -0300 | |
|---|---|---|
| committer | 2016-11-15 14:18:53 -0300 | |
| commit | 1ad5102b7ddd181bb9c632b124d3ea4c7db28be6 (patch) | |
| tree | 73dda18465d0f4b8eb52d4482282a387c9f67c95 /scripts/github-release.py | |
| parent | b67294f76809a681ff73f209ed691a3e3f00563d (diff) | |
| parent | ffb671c61a24a9086343b54bad080e145ff33fc5 (diff) | |
Merge tag 'upstream/7.8.1'
Upstream version 7.8.1
# gpg: Firmado el mar 15 nov 2016 14:18:48 ART
# gpg: usando RSA clave A6C7B88B9583046A11C5403E0B00FB6CEBE2D002
# gpg: Firma correcta de "Ulises Vitulli <dererk@debian.org>" [absoluta]
# gpg: alias "Dererk <dererk@torproject.org>" [absoluta]
# gpg: alias "Ulises Vitulli <uvitulli@fi.uba.ar>" [absoluta]
# gpg: alias "Ulises Vitulli <dererk@satellogic.com>" [absoluta]
Diffstat (limited to 'scripts/github-release.py')
| -rwxr-xr-x | scripts/github-release.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/github-release.py b/scripts/github-release.py index 8280fda..a9ab898 100755 --- a/scripts/github-release.py +++ b/scripts/github-release.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import subprocess -import sys import os +import argparse if not os.path.exists('.pypt/gh-token'): print("To use this script, you must create a GitHub token first.") @@ -9,11 +9,19 @@ if not os.path.exists('.pypt/gh-token'): print("Then, put it in a file named .pypt/gh-token") exit(1) -inpf = input if sys.version_info[0] == 3 else raw_input +parser = argparse.ArgumentParser(description="GitHub Release helper") +parser.add_argument("FILE", nargs=1, help="Markdown file to use") +parser.add_argument("TAG", nargs=1, help="Tag name (usually vX.Y.Z)") + +args = parser.parse_args() + +if not args.TAG[0].startswith("v"): + print("WARNING: tag should start with v") + i = input("Add `v` to tag? [y/n] ") + if i.lower().strip().startswith('y'): + args.TAG[0] = 'v' + args.TAG[0] -FILE = inpf("Markdown file to use: ") BASEDIR = os.getcwd() REPO = 'getnikola/nikola' -TAG = inpf("Tag name (usually vX.Y.Z): ") -subprocess.call(['.pypt/ghrel', FILE, BASEDIR, REPO, TAG]) +subprocess.call(['.pypt/ghrel', args.FILE[0], BASEDIR, REPO, args.TAG[0]]) |
