Skip to content

Commit 7672497

Browse files
committed
fix(desktop): follow host process and node import conventions
1 parent 7d2896d commit 7672497

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/desktop/src/app/DesktopCliCommand.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as NodeServices from "@effect/platform-node/NodeServices";
22
import { afterEach, beforeEach, expect, it } from "@effect/vitest";
3+
import * as HostProcess from "@t3tools/shared/HostProcess";
34
import * as Effect from "effect/Effect";
45
import * as FileSystem from "effect/FileSystem";
56
import * as Option from "effect/Option";
@@ -177,7 +178,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
177178
}).pipe(Effect.scoped),
178179
);
179180

180-
it.effect.skipIf(process.platform === "win32")(
181+
it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")(
181182
"skips a t3 directory or a file this user cannot execute",
182183
() =>
183184
Effect.gen(function* () {

‎apps/desktop/src/app/DesktopCliCommand.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @effect-diagnostics-next-line nodeBuiltinImport:off -- FileSystem.access has no execute check.
2-
import { access, constants } from "node:fs/promises";
2+
import * as NodeFSP from "node:fs/promises";
33

44
import type { DesktopCliCommandState } from "@t3tools/contracts";
55
import * as Context from "effect/Context";
@@ -124,7 +124,7 @@ export const make = Effect.gen(function* () {
124124
const isExecutableFile = Effect.fn("DesktopCliCommand.isExecutableFile")(
125125
function* (target: string) {
126126
if ((yield* fs.stat(target)).type !== "File") return false;
127-
yield* Effect.tryPromise(() => access(target, constants.X_OK));
127+
yield* Effect.tryPromise(() => NodeFSP.access(target, NodeFSP.constants.X_OK));
128128
return true;
129129
},
130130
Effect.orElseSucceed(() => false),

0 commit comments

Comments
 (0)