MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / browseRootLabel

Function browseRootLabel

apps/server/internal/httpserver/server.go:402–416  ·  view source on GitHub ↗
(path string, index int)

Source from the content-addressed store, hash-verified

400}
401
402func browseRootLabel(path string, index int) string {
403 cleaned := filepath.Clean(path)
404 root := filesystemRootForPath(cleaned)
405 if cleaned == root {
406 return "Mounted Root"
407 }
408 base := filepath.Base(cleaned)
409 if base == "." || base == string(filepath.Separator) || strings.TrimSpace(base) == "" {
410 return "Mounted Root"
411 }
412 if index == 0 {
413 return base
414 }
415 return base
416}
417
418func defaultBrowsePath() string {
419 if home, err := os.UserHomeDir(); err == nil && strings.TrimSpace(home) != "" {

Callers 1

browseShortcutsMethod · 0.85

Calls 1

filesystemRootForPathFunction · 0.85

Tested by

no test coverage detected