Skip to content

Commit 8cc5a60

Browse files
fix: properly account for .exe suffix on windows
1 parent 10b451c commit 8cc5a60

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

vvm/install.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def get_executable(
103103
version = to_vyper_version(version)
104104
vyper_bin = get_vvm_install_folder(vvm_binary_path).joinpath(f"vyper-{version}")
105105
if _get_os_name() == "windows":
106-
vyper_bin = vyper_bin.with_suffix(".exe")
106+
vyper_bin = vyper_bin.with_name(f"{vyper_bin.name}.exe")
107107

108108
if not vyper_bin.exists():
109109
raise VyperNotInstalled(
@@ -198,7 +198,11 @@ def get_installed_vyper_versions(vvm_binary_path: Union[Path, str] = None) -> Li
198198
List of Version objects of installed `vyper` versions.
199199
"""
200200
install_path = get_vvm_install_folder(vvm_binary_path)
201-
return sorted([Version(i.name[6:]) for i in install_path.glob("vyper-*")], reverse=True)
201+
if _get_os_name() == "windows":
202+
version_list = [i.stem[6:] for i in install_path.glob("vyper-*")]
203+
else:
204+
version_list = [i.name[6:] for i in install_path.glob("vyper-*")]
205+
return sorted([Version(i) for i in version_list], reverse=True)
202206

203207

204208
def install_vyper(
@@ -250,7 +254,7 @@ def install_vyper(
250254

251255
install_path = get_vvm_install_folder(vvm_binary_path).joinpath(f"vyper-{version}")
252256
if os_name == "windows":
253-
install_path = install_path.with_suffix(".exe")
257+
install_path = install_path.with_name(f"{install_path.name}.exe")
254258

255259
url = BINARY_DOWNLOAD_BASE.format(version, asset["name"])
256260
content = _download_vyper(url, headers, show_progress)

0 commit comments

Comments
 (0)