Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix in tag.py #116

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tag.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
import argparse
import fileinput
import os
import re
import subprocess
import fileinput
import sys

def check_version_format(version):
Expand Down Expand Up @@ -39,13 +39,15 @@ def commit_change(version):
return
run_command(['git', 'commit', '-m', f'Release {version}'])

def show_status():
run_command(['git', 'status', '--porcelain'])

def create_tag(tag, force):
if force:
run_command(['git', 'tag', '-f', tag])
else:
run_command(['git', 'tag', tag])


def push_change(remote, tag, force):
run_command(['git', 'push', remote, 'HEAD'])
if force:
Expand Down Expand Up @@ -81,7 +83,8 @@ def main():
sys.exit(1)

write_version(version)
commit_change(version, force)
commit_change(version)
show_status()
create_tag(tag, force)
if remote:
push_change(remote, tag, force)
Expand Down