(ctx context.Context, client *daggerClient, hostPath string)
| 166 | } |
| 167 | |
| 168 | func (srv *Server) loadWorkspaceFromHostPath(ctx context.Context, client *daggerClient, hostPath string) error { |
| 169 | cwd, err := client.engineUtilClient.AbsPath(ctx, hostPath) |
| 170 | if err != nil { |
| 171 | return fmt.Errorf("workspace detection: %w", err) |
| 172 | } |
| 173 | |
| 174 | resolveLocalRef := func(ws *workspace.Workspace, relPath string) string { |
| 175 | return filepath.Join(ws.Root, ws.Path, relPath) |
| 176 | } |
| 177 | |
| 178 | return srv.detectAndLoadWorkspace(ctx, client, |
| 179 | core.NewCallerStatFS(client.engineUtilClient), |
| 180 | client.engineUtilClient.ReadCallerHostFile, |
| 181 | cwd, |
| 182 | resolveLocalRef, |
| 183 | nil, |
| 184 | true, // isLocal |
| 185 | ) |
| 186 | } |
| 187 | |
| 188 | func (srv *Server) loadWorkspaceFromDeclaredRef(ctx context.Context, client *daggerClient, workspaceRef string) error { |
| 189 | // Resolve as local path first (relative to the connecting client's cwd). |
no test coverage detected