(list []dto.ComposeInfo)
| 450 | } |
| 451 | |
| 452 | func loadEnv(list []dto.ComposeInfo) []dto.ComposeInfo { |
| 453 | for i := 0; i < len(list); i++ { |
| 454 | tmpPath := list[i].Path |
| 455 | if strings.Contains(list[i].Path, ",") { |
| 456 | tmpPath = strings.Split(list[i].Path, ",")[0] |
| 457 | } |
| 458 | envFilePath := path.Join(path.Dir(tmpPath), ".env") |
| 459 | file, err := os.ReadFile(envFilePath) |
| 460 | if err != nil { |
| 461 | continue |
| 462 | } |
| 463 | list[i].Env = string(file) |
| 464 | } |
| 465 | return list |
| 466 | } |
| 467 | |
| 468 | func newComposeEnv(pathItem string, env string) error { |
| 469 | envFilePath := path.Join(path.Dir(pathItem), ".env") |
no outgoing calls
no test coverage detected