|
74 | 74 | from codegen.sdk.typescript.statements.import_statement import TSImportStatement |
75 | 75 | from codegen.sdk.typescript.symbol import TSSymbol |
76 | 76 | from codegen.sdk.typescript.type_alias import TSTypeAlias |
77 | | -from codegen.sdk.utils import determine_project_language |
| 77 | +from codegen.sdk.utils import determine_project_language, split_git_path |
78 | 78 | from codegen.shared.decorators.docs import apidoc, noapidoc, py_noapidoc |
79 | 79 | from codegen.shared.exceptions.control_flow import MaxAIRequestsError |
80 | 80 | from codegen.shared.performance.stopwatch_utils import stopwatch |
@@ -148,11 +148,16 @@ def __init__( |
148 | 148 |
|
149 | 149 | # Initialize project with repo_path if projects is None |
150 | 150 | if repo_path is not None: |
| 151 | + # Split repo_path into (git_root, base_path) |
151 | 152 | repo_path = os.path.abspath(repo_path) |
| 153 | + git_root, base_path = split_git_path(repo_path) |
| 154 | + # Create repo_config |
152 | 155 | repo_config = BaseRepoConfig() |
| 156 | + # Create main project |
153 | 157 | main_project = ProjectConfig( |
154 | | - repo_operator=LocalRepoOperator(repo_config=repo_config, repo_path=repo_path), |
| 158 | + repo_operator=LocalRepoOperator(repo_config=repo_config, repo_path=git_root), |
155 | 159 | programming_language=determine_project_language(repo_path), |
| 160 | + base_path=base_path, |
156 | 161 | ) |
157 | 162 | projects = [main_project] |
158 | 163 | else: |
|
0 commit comments