( options: StartServerOptions, )
| 290 | }); |
| 291 | |
| 292 | const startServerOrAttachOwnedDataDir = ( |
| 293 | options: StartServerOptions, |
| 294 | ): Effect.Effect<LocalServerStartResult, Error, FileSystem.FileSystem | PlatformPath.Path> => |
| 295 | Effect.tryPromise({ |
| 296 | try: () => startServer(options), |
| 297 | catch: (cause) => cause, |
| 298 | }).pipe( |
| 299 | Effect.map((server) => ({ kind: "started" as const, server })), |
| 300 | Effect.catch((cause) => { |
| 301 | const ownership = findDataDirOwnershipHeld(cause); |
| 302 | if (!ownership) return Effect.fail(toError(cause)); |
| 303 | return attachToOwnedDataDirServerOrFail({ lockPath: ownership.lockPath }).pipe( |
| 304 | Effect.map((manifest) => ({ kind: "attached" as const, manifest })), |
| 305 | ); |
| 306 | }), |
| 307 | ); |
| 308 | |
| 309 | const parseDaemonUrl = (baseUrl: string) => |
| 310 | Effect.try({ |
no test coverage detected