(w io.Writer, cs *iostreams.ColorScheme, dir, indent string)
| 1161 | } |
| 1162 | |
| 1163 | func 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. |
no test coverage detected
searching dependent graphs…