This is used only by compose and config. docs has it's own.
(dir, output string, buf *bytes.Buffer)
| 217 | |
| 218 | // This is used only by compose and config. docs has it's own. |
| 219 | func writeFile(dir, output string, buf *bytes.Buffer) { |
| 220 | _ = os.Mkdir(dir, dirMode) |
| 221 | filePath := filepath.Join(dir, output) |
| 222 | log.Printf("Writing: %s, size: %d", filePath, buf.Len()) |
| 223 | buf.WriteString("## => Content Auto Generated, " + |
| 224 | strings.ToUpper(time.Now().UTC().Round(time.Second).Format("02 Jan 2006 15:04 UTC")+"\n")) |
| 225 | |
| 226 | if err := os.WriteFile(filePath, buf.Bytes(), fileMode); err != nil { |
| 227 | log.Fatalln(err) |
| 228 | } |
| 229 | } |
no test coverage detected