commands

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bump

func Bump() *cli.Command

Bump returns the bump command that creates and optionally pushes a git tag. This is the primary version management command.

func BumpPre added in v1.3.0

func BumpPre() *cli.Command

BumpPre returns the 'forge bump pre' subcommand for managing prerelease versions.

func Changelog

func Changelog() *cli.Command

Changelog returns the changelog command.

func CheckForExistingTags

func CheckForExistingTags(ctx context.Context, repoDir, tagPrefix string) (bool, error)

CheckForExistingTags checks if any version tags exist

func CheckGitClean

func CheckGitClean(ctx context.Context, repoDir string, allowDirty bool) error

CheckGitClean checks if the git working directory has uncommitted changes

func Hotfix added in v1.3.0

func Hotfix() *cli.Command

Hotfix returns the hotfix command group.

func Init

func Init() *cli.Command

Init returns the init command that initializes a new forge.yaml configuration file.

func NoTagsError

func NoTagsError(tagPrefix, initialVersion string) error

NoTagsError returns an error for when no version tags are found

func Retag added in v1.3.0

func Retag() *cli.Command

Retag returns the retag command that moves an existing tag to a different commit.

func Validate

func Validate() *cli.Command

Validate returns the validate command that checks forge.yaml and git state

func ValidateRequirements

func ValidateRequirements(ctx context.Context, repoDir string) error

ValidateRequirements checks for forge.yaml and git repository. This should be called for commands that require these dependencies.

func Version

func Version() *cli.Command

Version returns the version command that prints the current version based on the last valid git tag.

Types

type ActiveHotfix added in v1.3.0

type ActiveHotfix struct {
	Branch  string `json:"branch"`
	BaseTag string `json:"base_tag"`
	LastTag string `json:"last_tag"`
	Count   int    `json:"count"`
}

ActiveHotfix represents an active hotfix branch.

type ForgeError

type ForgeError struct {
	Title       string
	Description string
	Suggestions []string
}

ForgeError represents a user friendly error with actionable suggestions.

func (*ForgeError) Error

func (e *ForgeError) Error() string

type HotfixBumpOutput added in v1.3.0

type HotfixBumpOutput struct {
	Tag      string `json:"tag"`
	Version  string `json:"version"`
	BaseTag  string `json:"base_tag"`
	Sequence int    `json:"sequence"`
	Branch   string `json:"branch,omitempty"`
	Created  bool   `json:"created"`
	Pushed   bool   `json:"pushed"`
	Message  string `json:"message"`
}

HotfixBumpOutput represents the output of hotfix bump command.

type HotfixCreateOutput added in v1.3.0

type HotfixCreateOutput struct {
	Branch  string `json:"branch"`
	BaseTag string `json:"base_tag"`
	Created bool   `json:"created"`
	Message string `json:"message"`
}

HotfixCreateOutput represents the output of hotfix create command.

type HotfixListOutput added in v1.3.0

type HotfixListOutput struct {
	BaseTag  string   `json:"base_tag"`
	Hotfixes []string `json:"hotfixes"`
	Count    int      `json:"count"`
}

HotfixListOutput represents the output of hotfix list command.

type HotfixStatusOutput added in v1.3.0

type HotfixStatusOutput struct {
	OnHotfixBranch bool           `json:"on_hotfix_branch"`
	CurrentBranch  string         `json:"current_branch"`
	BaseTag        string         `json:"base_tag,omitempty"`
	LastHotfix     string         `json:"last_hotfix,omitempty"`
	NextHotfix     string         `json:"next_hotfix,omitempty"`
	HotfixCount    int            `json:"hotfix_count"`
	ActiveHotfixes []ActiveHotfix `json:"active_hotfixes,omitempty"`
}

HotfixStatusOutput represents the output of hotfix status command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL