MCPcopy Create free account
hub / github.com/catppuccin/cli / OSReadDir

Function OSReadDir

internal/utils/systems.go:54–69  ·  view source on GitHub ↗

OSReadDir expands a directory path into a list of files within that directory. Not recursive.

(root string)

Source from the content-addressed store, hash-verified

52
53// OSReadDir expands a directory path into a list of files within that directory. Not recursive.
54func OSReadDir(root string) ([]string, error) {
55 var files []string
56 f, err := os.Open(root)
57 if err != nil {
58 return files, err
59 }
60 fileInfo, err := f.Readdir(-1)
61 f.Close()
62 if err != nil {
63 return files, err
64 }
65 for _, file := range fileInfo {
66 files = append(files, file.Name())
67 }
68 return files, nil
69}
70
71// CloneRepo clones a repo into the specified location.
72func CloneRepo(stagePath string, repo string) string {

Callers 1

HandleDirPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected