diff --git a/crytic_compile/crytic_compile.py b/crytic_compile/crytic_compile.py index 3996150..605a20a 100644 --- a/crytic_compile/crytic_compile.py +++ b/crytic_compile/crytic_compile.py @@ -124,7 +124,7 @@ def __init__(self, target: Union[str, AbstractPlatform], **kwargs: str) -> None: Args: target (Union[str, AbstractPlatform]): Target - **kwargs: additional arguments + **kwargs: additional arguments. Used: "cwd" """ # dependencies is needed for platform conversion @@ -145,7 +145,11 @@ def __init__(self, target: Union[str, AbstractPlatform], **kwargs: str) -> None: # Note: line 1 is at index 0 self._cached_line_to_code: Dict[Filename, List[bytes]] = {} - self._working_dir = Path.cwd() + custom_cwd = kwargs.get("cwd") + if custom_cwd is not None: + self._working_dir = Path(custom_cwd) + else: + self._working_dir = Path.cwd() # pylint: disable=too-many-nested-blocks if isinstance(target, str):