Skip to content

Commit

Permalink
release: 🔖 version 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kikkomep committed Sep 25, 2024
2 parents 783c974 + b101cd9 commit 6eee97b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "roc-validator"
version = "0.2.0"
version = "0.2.1"
description = "A Python package to validate RO-Crates"
authors = [
"Marco Enrico Piras <[email protected]>",
Expand Down
10 changes: 8 additions & 2 deletions rocrate_validator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run_git_command(command: list[str]) -> Optional[str]:
import subprocess

try:
output = subprocess.check_output(command).decode().strip()
output = subprocess.check_output(command, stderr=subprocess.DEVNULL).decode().strip()
return output
except Exception as e:
if logger.isEnabledFor(logging.DEBUG):
Expand Down Expand Up @@ -88,7 +88,13 @@ def get_commit_distance(tag: Optional[str] = None) -> int:
"""
if not tag:
tag = get_last_tag()
return int(run_git_command(['git', 'rev-list', '--count', 'HEAD' if not tag else f"{tag}..HEAD"]))
try:
return int(run_git_command(['git', 'rev-list', '--count', f"{tag}..HEAD"]))
except Exception as e:
if logger.isEnabledFor(logging.DEBUG):
logger.debug(e)

return 0


def get_last_tag() -> str:
Expand Down

0 comments on commit 6eee97b

Please sign in to comment.