Skip to content

Commit 44e5561

Browse files
committed
Add ref for version
1 parent dd694fa commit 44e5561

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/viur_cli/utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import typing
66
import datetime
77
import getpass
8+
import subprocess
89

910

1011
def rmdir(dir):
@@ -95,7 +96,9 @@ def replace_vars(string: str, vars: typing.Optional[typing.Dict[str, str]] = Non
9596
old_string = string
9697
for var, content in vars.items():
9798
string = string.replace(f"$({var})", str(content))
98-
99+
if "$(ref)" in string:
100+
ref = subprocess.check_output("git rev-parse --short HEAD", shell=True)
101+
string = string.replace(f"$(ref)", str(ref))
99102
return string
100103

101104

0 commit comments

Comments
 (0)