History

Format workspace filesystem effect chains

Cursor Agent committed 4 months ago

Commit e72791d1 parent b356b221 file · +12 −12Browse files

Showing the changes to apps/server/src/workspace/WorkspaceFileSystem.ts (1 of 1 file). Show all

Unified · Split

apps/server/src/workspace/WorkspaceFileSystem.ts+12−12
@@ -154,12 +154,12 @@ export const make = Effect.gen(function* () { · 153 unmodified lines
154154 cause,
155155 });
156156
157− const realWorkspaceRoot = yield* fileSystem.realPath(input.cwd).pipe(
158− Effect.mapError(toOperationError("realpath-workspace-root", input.cwd)),
159− );
160− const realTargetPath = yield* fileSystem.realPath(target.absolutePath).pipe(
161− Effect.mapError(toOperationError("realpath-target", target.absolutePath)),
162− );
157+ const realWorkspaceRoot = yield* fileSystem
158+ .realPath(input.cwd)
159+ .pipe(Effect.mapError(toOperationError("realpath-workspace-root", input.cwd)));
160+ const realTargetPath = yield* fileSystem
161+ .realPath(target.absolutePath)
162+ .pipe(Effect.mapError(toOperationError("realpath-target", target.absolutePath)));
163163 const relativeRealPath = path.relative(realWorkspaceRoot, realTargetPath);
164164 if (
165165 relativeRealPath.startsWith(`..${path.sep}`) ||
@@ -176,9 +176,9 @@ export const make = Effect.gen(function* () { · 10 unmodified lines
176176
177177 return yield* Effect.scoped(
178178 Effect.gen(function* () {
179− const file = yield* fileSystem.open(realTargetPath, { flag: "r" }).pipe(
180− Effect.mapError(toOperationError("open", realTargetPath, realTargetPath)),
181− );
179+ const file = yield* fileSystem
180+ .open(realTargetPath, { flag: "r" })
181+ .pipe(Effect.mapError(toOperationError("open", realTargetPath, realTargetPath)));
182182 const stat = yield* file.stat.pipe(
183183 Effect.mapError(toOperationError("stat", realTargetPath, realTargetPath)),
184184 );
@@ -197,9 +197,9 @@ export const make = Effect.gen(function* () { · 12 unmodified lines
197197 bytesToRead === 0
198198 ? new Uint8Array()
199199 : Option.getOrElse(
200− yield* file.readAlloc(bytesToRead).pipe(
201− Effect.mapError(toOperationError("read", realTargetPath, realTargetPath)),
202− ),
200+ yield* file
201+ .readAlloc(bytesToRead)
202+ .pipe(Effect.mapError(toOperationError("read", realTargetPath, realTargetPath))),
203203 () => new Uint8Array(),
204204 );
205205 if (fileBytes.includes(0)) {