Skip to content

Commit

Permalink
find executable on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Mar 5, 2024
1 parent e30d752 commit 8b42cb4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion airbyte/_factories/connector_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

import shutil
import sys
import warnings
from pathlib import Path
from typing import Any
Expand Down Expand Up @@ -83,9 +84,18 @@ def get_source(
# Assume this is a path
local_executable = Path(local_executable).absolute()
else:
if sys.platform == "win32":
local_executable = f"{local_executable}.exe"

which_executable = shutil.which(local_executable)
if which_executable is None:
raise FileNotFoundError(local_executable)
raise exc.AirbyteConnectorExecutableNotFoundError(
connector_name=name,
context={
"executable": local_executable,
"working_directory": Path.cwd().absolute(),
},
) from FileNotFoundError(local_executable)
local_executable = Path(which_executable).absolute()

print(f"Using local `{name}` executable: {local_executable!s}")
Expand Down

0 comments on commit 8b42cb4

Please sign in to comment.