MCPcopy Create free account
hub / github.com/cli/cli / printTreeDir

Function printTreeDir

pkg/cmd/skills/install/install.go:1163–1185  ·  view source on GitHub ↗
(w io.Writer, cs *iostreams.ColorScheme, dir, indent string)

Source from the content-addressed store, hash-verified

1161}
1162
1163func printTreeDir(w io.Writer, cs *iostreams.ColorScheme, dir, indent string) {
1164 entries, err := os.ReadDir(dir)
1165 if err != nil {
1166 fmt.Fprintf(w, "%s%s\n", indent, cs.Muted("(could not read directory)"))
1167 return
1168 }
1169 for i, entry := range entries {
1170 isLast := i == len(entries)-1
1171 connector := "├── "
1172 childIndent := "│ "
1173 if isLast {
1174 connector = "└── "
1175 childIndent = " "
1176 }
1177 name := entry.Name()
1178 if entry.IsDir() {
1179 fmt.Fprintf(w, "%s%s%s\n", indent, cs.Muted(connector), cs.Bold(name+"/"))
1180 printTreeDir(w, cs, filepath.Join(dir, name), indent+cs.Muted(childIndent))
1181 } else {
1182 fmt.Fprintf(w, "%s%s%s\n", indent, cs.Muted(connector), name)
1183 }
1184 }
1185}
1186
1187// printPreInstallDisclaimer prints a warning that installed skills are unverified
1188// and should be inspected before use.

Callers 1

printFileTreeFunction · 0.85

Calls 4

MutedMethod · 0.80
BoldMethod · 0.80
JoinMethod · 0.80
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…