Add website publish code

This commit is contained in:
Kovid Goyal
2018-05-30 10:41:37 +05:30
parent 21d7cc1a60
commit e4163fca6a
2 changed files with 26 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ version = '%s.%s.%s' % (nv.group(1), nv.group(2), nv.group(3))
appname = re.search(
r"^appname\s+=\s+'([^']+)'", raw, flags=re.MULTILINE).group(1)
ALL_ACTIONS = 'build tag upload'.split()
ALL_ACTIONS = 'build tag upload website'.split()
def call(*cmd):
@@ -48,6 +48,10 @@ def run_tag(args):
call('git push origin v{0}'.format(version))
def run_website(args):
call('docs/publish.py')
class ReadFileWithProgressReporting(io.BufferedReader): # {{{
def __init__(self, path, mode='rb'):
io.BufferedReader.__init__(self, open(path, mode))
@@ -278,7 +282,7 @@ def run_upload(args):
def require_git_master(branch='master'):
b = subprocess.check_output(['git', 'symbolic-ref', '--short', 'HEAD']).decode('utf-8').strip()
if b != branch:
raise SystemExit('You must be in the {} got branch'.format(branch))
raise SystemExit('You must be in the {} git branch'.format(branch))
def main():