Skip to content

Commit 52cdaca

Browse files
committed
Mute git version warnings by default
1 parent a3bda5f commit 52cdaca

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

workflow/rules/common.smk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_input_fasta(wildcards):
1616
return config["SAMPLES"][wildcards.sample]["fasta"]
1717

1818

19-
def get_repo_version(base_dir: str, default: str) -> str:
19+
def get_repo_version(base_dir: str, default: str, warn=False) -> str:
2020
"""Determines the workflow version from the git repository status.
2121
It first checks if the workflow is a git repository by looking for
2222
a .git folder. If it is, it reads the latest tag from the .git folder
@@ -40,5 +40,6 @@ def get_repo_version(base_dir: str, default: str) -> str:
4040
else:
4141
return f"commit {last_tag_description}"
4242
except subprocess.CalledProcessError as e:
43-
print(f"Repository tag not found: '{e}'")
43+
if warn:
44+
print(f"Repository tag not found: '{e}'")
4445
return f"v{default} (no git)"

0 commit comments

Comments
 (0)