From 950022030eb68a6714477457751296028af91c76 Mon Sep 17 00:00:00 2001 From: AJ Steers Date: Mon, 18 Mar 2024 14:04:50 -0700 Subject: [PATCH] fix connector path --- airbyte/_executor.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/airbyte/_executor.py b/airbyte/_executor.py index 6ce252cf..d5b46099 100644 --- a/airbyte/_executor.py +++ b/airbyte/_executor.py @@ -10,6 +10,7 @@ from platform import system from shutil import rmtree from typing import IO, TYPE_CHECKING, Any, NoReturn, cast +from typing_extensions import Literal from rich import print @@ -24,9 +25,13 @@ _LATEST_VERSION = "latest" +def _is_windows() -> bool: + return system().lower() == "windows" + + def _get_bin_dir(venv_path: Path, /) -> Path: """Get the directory where executables are installed.""" - if system().lower() == "windows": + if _is_windows(): return venv_path / "Scripts" return venv_path / "bin" @@ -173,7 +178,8 @@ def _get_venv_path(self) -> Path: return self.install_root / self._get_venv_name() def _get_connector_path(self) -> Path: - return _get_bin_dir(self._get_venv_path()) / self.name + suffix: Literal[".exe", ""] = ".exe" if _is_windows() else "" + return _get_bin_dir(self._get_venv_path()) / (self.name + suffix) def _run_subprocess_and_raise_on_failure(self, args: list[str]) -> None: result = subprocess.run(