commands

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SemverBump = map[UPDATE_SEMVER]func(*semver.Version){
	PATCH: func(v *semver.Version) { v.BumpPatch() },
	MINOR: func(v *semver.Version) { v.BumpMinor() },
	MAJOR: func(v *semver.Version) { v.BumpMajor() },
}

SemverBump a hashmap containing update functions for semver

Functions

func GetVersion

func GetVersion(line string) string

GetVersion retrieves the version number from a string

func IsVersionNo

func IsVersionNo(line string) bool

IsVersionNo checks if a string contains npm like version string

func Process

func Process(c *cli.Context, res Resouces) error

func ProcessVersionLine

func ProcessVersionLine(line string, update UPDATE_SEMVER) string

func ReplaceVersion

func ReplaceVersion(line, version string) string

ReplaceVersion replaces the verion of within a string input: "version": "1.1.1" ", "2.0.0" output: "version": "2.00"

Types

type Resouces

type Resouces struct {
	TargetFile string
	Update     UPDATE_SEMVER
}

type UPDATE_SEMVER

type UPDATE_SEMVER string
const (
	PATCH UPDATE_SEMVER = "PATCH"
	MINOR UPDATE_SEMVER = "MINOR"
	MAJOR UPDATE_SEMVER = "MAJOR"
)

Jump to

Keyboard shortcuts

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