Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit b95ea67

Browse files
committed
feat: Add version and update as subcommands
You can now call `version` or `update` in order to run specifically just the updater workflow.
1 parent f01cd6f commit b95ea67

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

gitcommit/gitcommit.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ def add_footer(commit_msg):
406406
def run(args):
407407
# print(sys.version + "/n")
408408

409+
if len(args) > 0 and args[0] in ["version", "update"]:
410+
check_for_update(verbose=True)
411+
return # Exit early
412+
409413
# Ensure the config directory exists
410414
os.makedirs(CONFIG_HOME_DIR, exist_ok=True)
411415

gitcommit/updater.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def find_version():
3434
raise RuntimeError("Unable to find version string in __version__.py.")
3535

3636

37-
def check_for_update():
37+
def check_for_update(verbose=False):
3838
try:
3939
tags = get_github_tags()
4040
except Exception as e:
@@ -61,3 +61,5 @@ def check_for_update():
6161
]
6262
)
6363
print_formatted_text(text, style=style)
64+
elif verbose:
65+
print("Current version:", cur_version)

0 commit comments

Comments
 (0)