Skip to content

Commit

Permalink
update to resolve_repo_root
Browse files Browse the repository at this point in the history
  • Loading branch information
rpmcginty committed Jun 26, 2024
1 parent d74c575 commit 2b099e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/aibs_informatics_cdk_lib/project/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import logging
import pathlib
from typing import List, Optional, Type
from typing import List, Optional, Type, Union

import constructs
from aibs_informatics_core.env import (
Expand All @@ -26,7 +26,7 @@
logger = logging.getLogger(__name__)


def resolve_repo_root() -> str:
def resolve_repo_root(start_path: Optional[Union[str, pathlib.Path]] = None) -> str:
"""Find the root of the git repository
Returns:
Expand All @@ -36,7 +36,7 @@ def resolve_repo_root() -> str:
next(
filter(
lambda p: (p / ".git").is_dir(), # type: ignore
pathlib.Path(__file__).absolute().parents,
pathlib.Path(start_path or __file__).absolute().parents,
)
)
)
Expand Down

0 comments on commit 2b099e6

Please sign in to comment.