(content, path string)
| 434 | } |
| 435 | |
| 436 | func recreateCompose(content, path string) error { |
| 437 | file, err := os.OpenFile(path, os.O_WRONLY|os.O_TRUNC, 0640) |
| 438 | if err != nil { |
| 439 | return err |
| 440 | } |
| 441 | defer file.Close() |
| 442 | write := bufio.NewWriter(file) |
| 443 | _, _ = write.WriteString(content) |
| 444 | write.Flush() |
| 445 | |
| 446 | if stdout, err := compose.Up(path); err != nil { |
| 447 | return errors.New(string(stdout)) |
| 448 | } |
| 449 | return nil |
| 450 | } |
| 451 | |
| 452 | func loadEnv(list []dto.ComposeInfo) []dto.ComposeInfo { |
| 453 | for i := 0; i < len(list); i++ { |
no test coverage detected