MCPcopy Create free account
hub / github.com/Mrs4s/six-cli / GetLocalTree

Method GetLocalTree

six_cloud/file.go:18–33  ·  view source on GitHub ↗
(localPath string)

Source from the content-addressed store, hash-verified

16}
17
18func (file *SixFile) GetLocalTree(localPath string) map[string]*SixFile {
19 if !fs.PathExists(localPath) {
20 _ = os.MkdirAll(localPath, os.ModePerm)
21 }
22 result := make(map[string]*SixFile)
23 if !file.IsDir {
24 result[models.CombinePaths(localPath, file.Name, "")] = file
25 return result
26 }
27 for _, childrenFile := range file.GetChildren() {
28 for path, node := range childrenFile.GetLocalTree(models.CombinePaths(localPath, file.Name, "")) {
29 result[path] = node
30 }
31 }
32 return result
33}

Callers 1

DownloadMethod · 0.95

Calls 3

GetChildrenMethod · 0.95
PathExistsFunction · 0.92
CombinePathsFunction · 0.92

Tested by

no test coverage detected