Documentation
¶
Index ¶
- func CheckChangelogEntry(changelogPath, tag string) error
- func Confirm(prompt string) bool
- func CopyFile(src, dst string) error
- func GitAdd(dir string, paths ...string) error
- func GitCheckoutMain(dir string) error
- func GitCommit(dir, msg string) error
- func GitDirtyPaths(dir, pathPrefix string) (string, error)
- func GitIsClean(dir string) (bool, error)
- func GitLatestTagWithMinor(dir, minor string) (string, error)
- func GitPull(dir string) error
- func GitPush(dir string) error
- func GitPushTags(dir string)
- func GitRun(dir string, args ...string) error
- func GitTagExists(dir, tag string) (bool, error)
- func GitTagSigned(dir, tag string) error
- func MinorVersion(tag string) string
- func ReplaceInFile(path, old, new string) (bool, error)
- func ReplaceLineInFile(path string, transform func(line string) string) (bool, error)
- func RunCommand(dir, name string, args ...string) error
- func ValidateTag(tag string) (semver string, err error)
- type Changelog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckChangelogEntry ¶
CheckChangelogEntry returns an error if the given tag has no entry in the CHANGELOG.md found at changelogPath. It looks for a line starting with "## [<tag>]" (case-insensitive bracket match).
func CopyFile ¶ added in v1.11.0
CopyFile copies a single file from src to dst, creating parent directories as needed.
func GitCheckoutMain ¶
func GitDirtyPaths ¶ added in v1.11.0
GitDirtyPaths returns the porcelain status lines for paths under the given path prefix (relative to dir's repo root), or empty if none are dirty.
func GitIsClean ¶
func GitLatestTagWithMinor ¶
GitLatestTagWithMinor returns the most recent tag in dir whose minor version matches the given minor string (e.g. "1.7"). Returns "" if none found.
func GitPushTags ¶
func GitPushTags(dir string)
func GitTagExists ¶
func GitTagSigned ¶
func MinorVersion ¶
MinorVersion extracts the "MAJOR.MINOR" prefix from a semver tag like "v1.7.3" → "1.7".
func ReplaceInFile ¶
ReplaceInFile replaces all occurrences of old with new in the file at path. Returns whether the file was modified.
func ReplaceLineInFile ¶
ReplaceLineInFile applies a per-line transform and writes back if changed.
func RunCommand ¶ added in v1.11.0
RunCommand runs an arbitrary command in dir, forwarding stdout/stderr to the terminal.
func ValidateTag ¶
Types ¶
type Changelog ¶
type Changelog struct {
// contains filtered or unexported fields
}