MCPcopy Index your code
hub / github.com/dagger/dagger / loadWorkspaceFromHostPath

Method loadWorkspaceFromHostPath

engine/server/session_workspaces.go:168–186  ·  view source on GitHub ↗
(ctx context.Context, client *daggerClient, hostPath string)

Source from the content-addressed store, hash-verified

166}
167
168func (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
188func (srv *Server) loadWorkspaceFromDeclaredRef(ctx context.Context, client *daggerClient, workspaceRef string) error {
189 // Resolve as local path first (relative to the connecting client's cwd).

Callers 2

loadWorkspaceFromHostMethod · 0.95

Calls 3

NewCallerStatFSFunction · 0.92
AbsPathMethod · 0.80

Tested by

no test coverage detected