( params: CompleteInstallFromSourceParams, )
| 202 | } |
| 203 | |
| 204 | async function completeInstallFromSource( |
| 205 | params: CompleteInstallFromSourceParams, |
| 206 | ): Promise<DaemonResponse> { |
| 207 | let retained: RetainedMaterializedPaths | undefined; |
| 208 | try { |
| 209 | retained = await maybeRetainInstallArtifact(params); |
| 210 | const result = await params.buildResult(retained); |
| 211 | const data = withSuccessText(result, buildInstallFromSourceMessage(result)); |
| 212 | recordInstallFromSourceAction({ |
| 213 | session: params.session, |
| 214 | sessionStore: params.sessionStore, |
| 215 | req: params.req, |
| 216 | data, |
| 217 | }); |
| 218 | return { ok: true, data }; |
| 219 | } catch (error) { |
| 220 | if (retained) { |
| 221 | await cleanupRetainedMaterializedPaths( |
| 222 | retained.materializationId, |
| 223 | params.req.meta?.tenantId, |
| 224 | ).catch(() => {}); |
| 225 | } |
| 226 | throw error; |
| 227 | } finally { |
| 228 | await params.prepared.cleanup(); |
| 229 | params.resolvedSourceCleanup(); |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | async function installPreparedIosArtifact( |
| 234 | device: SessionState['device'], |
no test coverage detected