mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-22 23:37:53 +00:00
build: unify git hook output
This commit is contained in:
parent
82767b6557
commit
df39abcbc9
1 changed files with 3 additions and 3 deletions
|
@ -33,10 +33,10 @@ def main():
|
|||
local_branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], universal_newlines=True).strip()
|
||||
wip_prefix = '^#\\d+(?:\\b.*)$'
|
||||
if re.match(wip_prefix, local_branch):
|
||||
print(f'{time}: The branch {local_branch} can not be pushed as it starts with a "#" which marks it as work in progress', file=open(".githooks/hooks.log", "a"))
|
||||
print(f'The branch {local_branch} can not be pushed as it starts with a "#" which marks it as work in progress')
|
||||
print(f'{time}: Branch "{local_branch}" was not pushed because its name starts with a "#" which marks it as work in progress', file=open(".githooks/hooks.log", "a"))
|
||||
print(f'Branch "{local_branch}" was not pushed because its name starts with a "#" which marks it as work in progress')
|
||||
exit(1)
|
||||
print(f'{time}: Pushing branch {local_branch}', file=open(".githooks/hooks.log", "a"))
|
||||
print(f'{time}: Branch "{local_branch}" was pushed', file=open(".githooks/hooks.log", "a"))
|
||||
exit(0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in a new issue