(config *Config, output, dir string)
| 39 | ) |
| 40 | |
| 41 | func createCompose(config *Config, output, dir string) { |
| 42 | buf := bytes.Buffer{} |
| 43 | buf.WriteString(composeHeader + "\n") |
| 44 | |
| 45 | // Loop the 'Order' list. |
| 46 | for _, section := range config.Order { |
| 47 | // If Order contains a missing section, bail. |
| 48 | if config.Sections[section] == nil { |
| 49 | log.Fatalln(section + ": in order, but missing from sections. This is a bug in definitions.yml.") |
| 50 | } |
| 51 | |
| 52 | if config.Defs[section] == nil { |
| 53 | buf.WriteString(config.Sections[section].makeCompose(config.Prefix, false)) |
| 54 | } else { |
| 55 | buf.WriteString(config.Sections[section]. |
| 56 | makeComposeDefined(config.Prefix, config.Defs[section], config.DefOrder[section], false)) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | buf.WriteString("\n") |
| 61 | writeFile(dir, output, &buf) |
| 62 | } |
| 63 | |
| 64 | func (h *Header) makeCompose(prefix string, bare bool) string { |
| 65 | var buf bytes.Buffer |
no test coverage detected