(composePath string)
| 385 | } |
| 386 | |
| 387 | func normalizeComposeFiles(composePath string) []string { |
| 388 | items := strings.Split(composePath, ",") |
| 389 | result := make([]string, 0) |
| 390 | seen := make(map[string]struct{}) |
| 391 | for _, item := range items { |
| 392 | item = strings.TrimSpace(item) |
| 393 | if item == "" { |
| 394 | continue |
| 395 | } |
| 396 | stat, err := os.Stat(item) |
| 397 | if err == nil && stat.IsDir() { |
| 398 | item = path.Join(item, "docker-compose.yml") |
| 399 | } |
| 400 | if _, err := os.Stat(item); err != nil { |
| 401 | continue |
| 402 | } |
| 403 | if _, ok := seen[item]; ok { |
| 404 | continue |
| 405 | } |
| 406 | seen[item] = struct{}{} |
| 407 | result = append(result, item) |
| 408 | } |
| 409 | sort.Strings(result) |
| 410 | return result |
| 411 | } |
| 412 | |
| 413 | func (c *composeBackupContext) close() { |
| 414 | if c.dockerClient != nil { |
no test coverage detected