Skip to content

Commit 4a9867d

Browse files
committed
fix(app): stabilize hostname fallback typing
1 parent 49e3947 commit 4a9867d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

packages/app/src/lib/usecases/actions/create-project.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type * as CommandExecutor from "@effect/platform/CommandExecutor"
22
import type { PlatformError } from "@effect/platform/Error"
33
import * as FileSystem from "@effect/platform/FileSystem"
44
import * as Path from "@effect/platform/Path"
5-
import { Effect, Either } from "effect"
5+
import { Effect } from "effect"
66

77
import type { CreateCommand, ParseError } from "../../core/domain.js"
88
import { deriveRepoPathParts } from "../../core/domain.js"
@@ -57,8 +57,10 @@ const resolveClonedOnHostname = (): Effect.Effect<string | undefined> =>
5757
try: () => import("node:os").then((os) => os.hostname()),
5858
catch: () => new Error("hostname lookup failed")
5959
}).pipe(
60-
Effect.either,
61-
Effect.map((result) => Either.match(result, { onLeft: () => undefined, onRight: (hostname) => hostname }))
60+
Effect.match({
61+
onFailure: (): string | undefined => undefined,
62+
onSuccess: (hostname): string | undefined => hostname
63+
})
6264
)
6365

6466
const makeCreateContext = (path: Path.Path, baseDir: string): CreateContext => {

0 commit comments

Comments
 (0)