(params: WorkspaceInitParams)
| 152 | } |
| 153 | |
| 154 | async initWorkspace(params: WorkspaceInitParams): Promise<WorkspaceInitResult> { |
| 155 | const projectInitLogger = { |
| 156 | ...params.initLogger, |
| 157 | // Individual runtimes report completion; suppress per-project completion so the |
| 158 | // multi-project workspace transitions out of initializing only after all runtimes finish. |
| 159 | logComplete: (_exitCode: number) => undefined, |
| 160 | }; |
| 161 | |
| 162 | const initResults: WorkspaceInitResult[] = []; |
| 163 | |
| 164 | for (const projectRuntime of this.projectRuntimes) { |
| 165 | const projectWorkspacePath = projectRuntime.runtime.getWorkspacePath( |
| 166 | projectRuntime.projectPath, |
| 167 | params.branchName |
| 168 | ); |
| 169 | const projectEnv = (await this.envResolver?.(projectRuntime.projectPath)) ?? params.env; |
| 170 | |
| 171 | const initResult = await projectRuntime.runtime.initWorkspace({ |
| 172 | ...params, |
| 173 | projectPath: projectRuntime.projectPath, |
| 174 | workspacePath: projectWorkspacePath, |
| 175 | initLogger: projectInitLogger, |
| 176 | env: projectEnv, |
| 177 | }); |
| 178 | |
| 179 | initResults.push(initResult); |
| 180 | } |
| 181 | |
| 182 | const firstFailure = initResults.find((result) => !result.success); |
| 183 | if (firstFailure) { |
| 184 | params.initLogger.logComplete(-1); |
| 185 | return firstFailure; |
| 186 | } |
| 187 | |
| 188 | params.initLogger.logComplete(0); |
| 189 | return { success: true }; |
| 190 | } |
| 191 | |
| 192 | async deleteWorkspace( |
| 193 | _projectPath: string, |
nothing calls this directly
no test coverage detected