MCPcopy Create free account
hub / github.com/compozy/agh / canonicalCLIWorkspacePath

Function canonicalCLIWorkspacePath

internal/cli/client.go:3262–3280  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

3260}
3261
3262func canonicalCLIWorkspacePath(path string) (string, error) {
3263 trimmed := strings.TrimSpace(path)
3264 if trimmed == "" {
3265 return "", errors.New("cli: workspace path is required")
3266 }
3267 abs, err := filepath.Abs(trimmed)
3268 if err != nil {
3269 return "", fmt.Errorf("cli: resolve workspace path %q: %w", path, err)
3270 }
3271 cleaned := filepath.Clean(abs)
3272 resolved, err := filepath.EvalSymlinks(cleaned)
3273 if err == nil {
3274 return resolved, nil
3275 }
3276 if errors.Is(err, os.ErrNotExist) {
3277 return cleaned, nil
3278 }
3279 return "", fmt.Errorf("cli: resolve workspace path %q: %w", cleaned, err)
3280}
3281
3282func (c *unixSocketClient) UpdateWorkspace(
3283 ctx context.Context,

Callers 1

workspaceRouteRefMethod · 0.85

Calls 1

IsMethod · 0.45

Tested by

no test coverage detected