|
1 | 1 | import { defaultTemplateConfig } from "@lib/core/domain" |
2 | | -import { runDockerInspectContainerRuntimeInfo, type DockerContainerRuntimeInfo } from "@lib/shell/docker" |
| 2 | +import { type DockerContainerRuntimeInfo, runDockerInspectContainerRuntimeInfo } from "@lib/shell/docker" |
3 | 3 | import { buildSshCommand, connectProjectSsh, probeProjectSshReady, type ProjectItem } from "@lib/usecases/projects" |
4 | 4 | import { Effect, pipe } from "effect" |
5 | 5 |
|
@@ -221,8 +221,9 @@ export const selectOpenProject = ( |
221 | 221 | ) |
222 | 222 | } |
223 | 223 |
|
224 | | -const uniqueContainerNames = (projects: ReadonlyArray<ApiProjectDetails>): ReadonlyArray<string> => |
225 | | - Array.from(new Set(projects.map((project) => project.containerName))) |
| 224 | +const uniqueContainerNames = ( |
| 225 | + projects: ReadonlyArray<ApiProjectDetails> |
| 226 | +): ReadonlyArray<string> => [...new Set(projects.map((project) => project.containerName))] |
226 | 227 |
|
227 | 228 | export const resolveRuntimeOwnedProject = <E, R>( |
228 | 229 | projects: ReadonlyArray<ApiProjectDetails>, |
@@ -257,7 +258,9 @@ export const resolveOpenProjectEffect = <E, R>( |
257 | 258 | deps: ResolveOpenProjectDeps<E, R> |
258 | 259 | ): Effect.Effect<ApiProjectDetails, ProjectResolutionError | E, R> => |
259 | 260 | resolveRuntimeOwnedProject(projects, selector, deps).pipe( |
260 | | - Effect.flatMap((ownedProject) => ownedProject === null ? selectOpenProject(projects, selector) : Effect.succeed(ownedProject)) |
| 261 | + Effect.flatMap((ownedProject) => |
| 262 | + ownedProject === null ? selectOpenProject(projects, selector) : Effect.succeed(ownedProject) |
| 263 | + ) |
261 | 264 | ) |
262 | 265 |
|
263 | 266 | const listProjectDetails = () => |
@@ -315,10 +318,10 @@ const attemptDirectConnect = <E, R>( |
315 | 318 | Effect.flatMap((ready) => |
316 | 319 | ready |
317 | 320 | ? pipe( |
318 | | - deps.log(`Opening SSH: ${item.sshCommand}`), |
319 | | - Effect.zipRight(deps.connect(item)), |
320 | | - Effect.as(true) |
321 | | - ) |
| 321 | + deps.log(`Opening SSH: ${item.sshCommand}`), |
| 322 | + Effect.zipRight(deps.connect(item)), |
| 323 | + Effect.as(true) |
| 324 | + ) |
322 | 325 | : Effect.succeed(false) |
323 | 326 | ) |
324 | 327 | ) |
|
0 commit comments