MCPcopy Create free account
hub / github.com/driangle/taskmd / resolvePath

Function resolvePath

apps/cli/internal/cli/registry.go:150–159  ·  view source on GitHub ↗

resolvePath expands tilde and makes relative paths absolute against baseDir.

(path, baseDir string)

Source from the content-addressed store, hash-verified

148
149// resolvePath expands tilde and makes relative paths absolute against baseDir.
150func resolvePath(path, baseDir string) (string, error) {
151 expanded, err := expandTilde(path)
152 if err != nil {
153 return "", err
154 }
155 if filepath.IsAbs(expanded) {
156 return filepath.Clean(expanded), nil
157 }
158 return filepath.Clean(filepath.Join(baseDir, expanded)), nil
159}
160
161// expandTilde replaces a leading ~ with the user's home directory.
162func expandTilde(path string) (string, error) {

Callers 1

resolveProjectEntryFunction · 0.85

Calls 1

expandTildeFunction · 0.85

Tested by

no test coverage detected