Documentation
¶
Overview ¶
Package render turns templates into the config files bothy launches its tools against. Everything it writes goes inside bothy's own tree (ADR-009).
Two rules:
- Every generated file says it is generated, and names where to put your own changes.
- Overrides are appended after the template, so your setting wins.
Index ¶
Constants ¶
View Source
const HeaderLines = 5
HeaderLines is how far into a file the marker may appear.
View Source
const Marker = "generated by bothy"
Marker identifies a bothy-generated file. It appears inside a comment whose syntax varies by file type, so detection looks for the marker in the first few lines rather than for an exact prefix.
Variables ¶
This section is empty.
Functions ¶
func IsGenerated ¶
IsGenerated reports whether a file carries bothy's header.
Types ¶
type Writer ¶
type Writer struct {
// Root is bothy's tree — config/ and bin/ both live under it. Write
// refuses any destination outside it.
Root string
// Overrides is ~/.config/bothy/overrides.
Overrides string
// DryRun reports what would happen without touching the filesystem.
DryRun bool
}
Writer renders templates into bothy's tree.
func (*Writer) Render ¶
Render executes a template and returns the bytes to write, header and overrides included. tool names the override subdirectory.
Click to show internal directories.
Click to hide internal directories.