Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

Commit 81b100e

Browse files
authored
Feat: Add option to check saved path matches with arg version (#177)
1 parent ac1ddc3 commit 81b100e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/ansys/tools/path/path.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -943,10 +943,19 @@ def _get_application_path(
943943
version: Optional[float] = None,
944944
find: bool = True,
945945
) -> Optional[str]:
946-
if version is None:
947-
exe_loc = _read_executable_path_from_config_file(product)
948-
if exe_loc is not None:
949-
return exe_loc
946+
_exe_loc = _read_executable_path_from_config_file(product)
947+
if _exe_loc is not None:
948+
if version is None:
949+
return _exe_loc
950+
else:
951+
_version = version_from_path(product, _exe_loc)
952+
if _version == version:
953+
return _exe_loc
954+
else:
955+
LOG.debug(
956+
f"Application {product} requested version {version} does not match with {_version} "
957+
f"in config file. Trying to find version {version} ..."
958+
)
950959

951960
LOG.debug(f"{product} path not found in config file")
952961
if not _has_plugin(product):

0 commit comments

Comments
 (0)