bumpversion

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoGit = errors.New("bumpversion: git not found")

ErrNoGit is returned when git is not in PATH.

View Source
var ErrTagsDiffer = errors.New("bumpversion: tags differ on remote")

ErrTagsDiffer is returned when remote tags differ from local ones.

View Source
var VersionRegexpRaw = `v?[0-9]+\.[0-9]+\.[0-9]+`

VersionRegexpRaw is a very simple version regexp pattern.

Functions

func Bump

func Bump(v *version.Version, s Segment) *version.Version

Bump bumps segment in version.

func Format

func Format(v *version.Version) string

Format formats a version.

func FormatSegments

func FormatSegments(major, minor, patch int) string

FormatSegments formats a version from segments.

func Parse

func Parse(s string) (v []*version.Version)

Parse returns a sorted list of versions parsed from s.

func Run

func Run(cmd *exec.Cmd) (err error)

Run runs cmd and pipes stdout/stderr on error only.

Types

type Bumper

type Bumper interface {
	Bump(Segment) (string, error)
}

Bumper defines an interface to bump version segment.

func NewBumper

func NewBumper() (b Bumper, err error)

NewBumper initializes and returns Bumper.

type GitConfig

type GitConfig struct {
	// C overrides a path to start git in.
	// It works like `-C` parameter (see `git help git`).
	// If empty, current working directory is used.
	C string
	// contains filtered or unexported fields
}

GitConfig configures git.

type Segment

type Segment int

Segment is a version segment.

const (
	Major Segment = iota
	Minor
	Patch
)

Version segments.

type VCS

type VCS interface {
	// Tags returns a list of consistent tags. It may return ErrTagsDiffer.
	Tags() ([]*version.Version, error)
	// Tags add a tag reference to a current commit.
	Tag(*version.Version) error
	// Push pushes tags to remote.
	Push() error
}

VCS defines an interface for a minimal VCS.

func NewGit

func NewGit(c GitConfig) (v VCS, err error)

NewGit returns VCS for git using cwd.

Jump to

Keyboard shortcuts

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