Skip to content

Commit 9ecefb4

Browse files
committed
Ensure 'v' prefix for non-latest version in download_binary function
1 parent 37d4424 commit 9ecefb4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sling/sling/bin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ def get_binary_cache_dir(version: str):
3939
def download_binary(version: str):
4040
"""Download the sling binary for the current platform"""
4141
system, arch, archive_name, binary_name = get_platform_info()
42-
version = 'v' + version.replace("v", '') # ensure 'v' is prefix
42+
43+
# Ensure version has 'v' prefix for non-latest versions
44+
if version != 'latest' and not version.startswith('v'):
45+
version = 'v' + version
46+
4347
cache_dir = get_binary_cache_dir(version)
4448
binary_path = cache_dir / binary_name
4549

0 commit comments

Comments
 (0)