Skip to content

Commit 5a21cd6

Browse files
only21milclaude
andcommitted
refactor(desktop): trace the execute-file check with Effect.fn
Main's prefer-effect-fn lint rule rejects an arrow that returns Effect.gen(...).pipe(...). Use the same Effect.fn form as isOurLink. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent b0ee62d commit 5a21cd6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,14 @@ export const make = Effect.gen(function* () {
128128

129129
// The shell runs only a regular file this user may execute. stat and access
130130
// both follow symlinks, so a link counts by what it points to.
131-
const isExecutableFile = (target: string) =>
132-
Effect.gen(function* () {
131+
const isExecutableFile = Effect.fn("DesktopCliCommand.isExecutableFile")(
132+
function* (target: string) {
133133
if ((yield* fs.stat(target)).type !== "File") return false;
134134
yield* Effect.tryPromise(() => NodeFSP.access(target, NodeFS.constants.X_OK));
135135
return true;
136-
}).pipe(Effect.orElseSucceed(() => false));
136+
},
137+
Effect.orElseSucceed(() => false),
138+
);
137139

138140
const firstOnPath = Effect.gen(function* () {
139141
for (const directory of pathEntries(process.env.PATH, ":")) {

0 commit comments

Comments
 (0)