(localPath string)
| 16 | } |
| 17 | |
| 18 | func (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 | } |
no test coverage detected