Showing the changes to apps/server/src/workspace/WorkspaceFileSystem.ts (1 of 3 files). Show all
Unified · Split
| @@ -140,30 +140,32 @@ export const make = Effect.gen(function* () { · 139 unmodified lines | ||
| 140 | 140 | relativePath: input.relativePath, |
| 141 | 141 | }); |
| 142 | 142 | |
| 143 | − const realWorkspaceRoot = yield* Effect.tryPromise({ | |
| 144 | − try: () => NodeFSP.realpath(input.cwd), | |
| 145 | − catch: (cause) => | |
| 146 | − new WorkspaceFileSystemOperationError({ | |
| 147 | − workspaceRoot: input.cwd, | |
| 148 | − relativePath: input.relativePath, | |
| 149 | − resolvedPath: target.absolutePath, | |
| 150 | − operationPath: input.cwd, | |
| 151 | − operation: "realpath-workspace-root", | |
| 152 | − cause, | |
| 153 | − }), | |
| 154 | − }); | |
| 155 | − const realTargetPath = yield* Effect.tryPromise({ | |
| 156 | − try: () => NodeFSP.realpath(target.absolutePath), | |
| 157 | − catch: (cause) => | |
| 158 | − new WorkspaceFileSystemOperationError({ | |
| 159 | − workspaceRoot: input.cwd, | |
| 160 | − relativePath: input.relativePath, | |
| 161 | − resolvedPath: target.absolutePath, | |
| 162 | − operationPath: target.absolutePath, | |
| 163 | − operation: "realpath-target", | |
| 164 | − cause, | |
| 165 | − }), | |
| 166 | − }); | |
| 143 | + const realWorkspaceRoot = yield* fileSystem.realPath(input.cwd).pipe( | |
| 144 | + Effect.mapError( | |
| 145 | + (cause) => | |
| 146 | + new WorkspaceFileSystemOperationError({ | |
| 147 | + workspaceRoot: input.cwd, | |
| 148 | + relativePath: input.relativePath, | |
| 149 | + resolvedPath: target.absolutePath, | |
| 150 | + operationPath: input.cwd, | |
| 151 | + operation: "realpath-workspace-root", | |
| 152 | + cause, | |
| 153 | + }), | |
| 154 | + ), | |
| 155 | + ); | |
| 156 | + const realTargetPath = yield* fileSystem.realPath(target.absolutePath).pipe( | |
| 157 | + Effect.mapError( | |
| 158 | + (cause) => | |
| 159 | + new WorkspaceFileSystemOperationError({ | |
| 160 | + workspaceRoot: input.cwd, | |
| 161 | + relativePath: input.relativePath, | |
| 162 | + resolvedPath: target.absolutePath, | |
| 163 | + operationPath: target.absolutePath, | |
| 164 | + operation: "realpath-target", | |
| 165 | + cause, | |
| 166 | + }), | |
| 167 | + ), | |
| 168 | + ); | |
| 167 | 169 | const relativeRealPath = path.relative(realWorkspaceRoot, realTargetPath); |
| 168 | 170 | if ( |
| 169 | 171 | relativeRealPath.startsWith(`..${path.sep}`) || |