Showing the changes to apps/server/src/workspace/WorkspaceFileSystem.ts (1 of 1 file). Show all
Unified · Split
| @@ -154,12 +154,12 @@ export const make = Effect.gen(function* () { · 153 unmodified lines | ||
| 154 | 154 | cause, |
| 155 | 155 | }); |
| 156 | 156 | |
| 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))); | |
| 163 | 163 | const relativeRealPath = path.relative(realWorkspaceRoot, realTargetPath); |
| 164 | 164 | if ( |
| 165 | 165 | relativeRealPath.startsWith(`..${path.sep}`) || |
| @@ -176,9 +176,9 @@ export const make = Effect.gen(function* () { · 10 unmodified lines | ||
| 176 | 176 | |
| 177 | 177 | return yield* Effect.scoped( |
| 178 | 178 | 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))); | |
| 182 | 182 | const stat = yield* file.stat.pipe( |
| 183 | 183 | Effect.mapError(toOperationError("stat", realTargetPath, realTargetPath)), |
| 184 | 184 | ); |
| @@ -197,9 +197,9 @@ export const make = Effect.gen(function* () { · 12 unmodified lines | ||
| 197 | 197 | bytesToRead === 0 |
| 198 | 198 | ? new Uint8Array() |
| 199 | 199 | : 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))), | |
| 203 | 203 | () => new Uint8Array(), |
| 204 | 204 | ); |
| 205 | 205 | if (fileBytes.includes(0)) { |