| 139 | } |
| 140 | |
| 141 | function resolveProjectFromSession(params: InferPlatformParams): { |
| 142 | projectPath?: string; |
| 143 | workspacePath?: string; |
| 144 | scheme?: string; |
| 145 | } { |
| 146 | const defaults = params.sessionDefaults ?? sessionStore.getAll(); |
| 147 | const hasExplicitProjectPath = params.projectPath !== undefined; |
| 148 | const hasExplicitWorkspacePath = params.workspacePath !== undefined; |
| 149 | const projectPath = |
| 150 | params.projectPath ?? (params.workspacePath ? undefined : defaults.projectPath); |
| 151 | const workspacePath = |
| 152 | params.workspacePath ?? (params.projectPath ? undefined : defaults.workspacePath); |
| 153 | |
| 154 | if (projectPath && workspacePath && !hasExplicitProjectPath && !hasExplicitWorkspacePath) { |
| 155 | return { |
| 156 | projectPath: undefined, |
| 157 | workspacePath, |
| 158 | scheme: params.scheme ?? defaults.scheme, |
| 159 | }; |
| 160 | } |
| 161 | |
| 162 | return { |
| 163 | projectPath, |
| 164 | workspacePath, |
| 165 | scheme: params.scheme ?? defaults.scheme, |
| 166 | }; |
| 167 | } |
| 168 | |
| 169 | async function inferPlatformFromSimctl( |
| 170 | simulatorId: string | undefined, |