( options: StartServerOptions, )
| 304 | }); |
| 305 | |
| 306 | const startServerOrAttachOwnedDataDir = ( |
| 307 | options: StartServerOptions, |
| 308 | ): Effect.Effect<LocalServerStartResult, Error, FileSystem.FileSystem | PlatformPath.Path> => |
| 309 | Effect.tryPromise({ |
| 310 | try: () => startServer(options), |
| 311 | catch: (cause) => cause, |
| 312 | }).pipe( |
| 313 | Effect.map((server) => ({ kind: "started" as const, server })), |
| 314 | Effect.catch((cause) => { |
| 315 | const ownership = findDataDirOwnershipHeld(cause); |
| 316 | if (!ownership) return Effect.fail(toError(cause)); |
| 317 | return attachToOwnedDataDirServerOrFail({ lockPath: ownership.lockPath }).pipe( |
| 318 | Effect.map((manifest) => ({ kind: "attached" as const, manifest })), |
| 319 | ); |
| 320 | }), |
| 321 | ); |
| 322 | |
| 323 | const parseDaemonUrl = (baseUrl: string) => |
| 324 | Effect.try({ |
no test coverage detected