utils

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PlainRelease releases using Git
	PlainRelease int = iota
	// NpmRelease releases using npm
	NpmRelease
	// GemRelease release using "rake release" task
	GemRelease
)

Variables

This section is empty.

Functions

func ChangeVersion

func ChangeVersion(version *semver.Version, change string) *semver.Version

ChangeVersion changes the current version.

func Complete

func Complete()

Complete shows a completion message.

func Debug added in v1.1.0

func Debug(message string, args ...interface{})

Debug shows a debug message

func DetectRelease

func DetectRelease() int

DetectRelease detects which kind of release we have to use

func Fail

func Fail(message string, args ...interface{})

Fail shows a error message

func Fatal

func Fatal(message string, args ...interface{})

Fatal aborts the executable with a error message

func FinishStep

func FinishStep(code int)

FinishStep shows a step completion message.

func GetCurrentVersion

func GetCurrentVersion() *semver.Version

GetCurrentVersion return the current version.

func GetEmojiWidth

func GetEmojiWidth() int64

GetEmojiWidth Detects handling of emoji

func GetVersions

func GetVersions() semver.Collection

GetVersions return all current GIT versions.

func GitMustBeClean

func GitMustBeClean(reason string)

GitMustBeClean checks that the current working copy has not uncommitted changes

func Info

func Info(message string, args ...interface{})

Info shows a info message

func Log added in v1.1.0

func Log(destination *os.File, message string, args ...interface{})

Log shows a output message

func LogWithIcon added in v1.1.0

func LogWithIcon(destination *os.File, icon, message string, args ...interface{})

LogWithIcon shows a message with a custom icon

func NotifyExecution

func NotifyExecution(showOnly bool, showOnlyVerb, realVerb, message string, args ...interface{}) bool

NotifyExecution notifies about a execution of a operation

func NotifyStep

func NotifyStep(showOnly bool, color, showOnlyVerb, realVerb, message string, args ...interface{}) bool

NotifyStep notifies about a execution of a step

func SaveChanges

func SaveChanges(newVersion, currentVersion *semver.Version, changes []Change, dryRun bool)

SaveChanges persist changes from GIT to the CHANGELOG.md file.

func SpacedEmoji added in v1.1.0

func SpacedEmoji(emoji string) string

SpacedEmoji returns an emoji with a trailing space

func Success

func Success(message string, args ...interface{})

Success shows a success message

func UpdateGemVersion

func UpdateGemVersion(newVersion, currentVersion *semver.Version, commit, tag, dryRun bool)

UpdateGemVersion updates the current version by manipulating the version file.

func UpdateNpmVersion

func UpdateNpmVersion(newVersion, currentVersion *semver.Version, commit, tag, dryRun bool)

UpdateNpmVersion updates the current version using NPM.

func UpdatePlainVersion

func UpdatePlainVersion(newVersion, currentVersion *semver.Version, commit, tag, dryRun bool)

UpdatePlainVersion updates the current version according to a plain managament.

func UpdateVersion

func UpdateVersion(newVersion, currentVersion *semver.Version, dryRun bool)

UpdateVersion updates the current version.

func Warn added in v1.1.0

func Warn(message string, args ...interface{})

Warn shows a warning message

Types

type Change

type Change struct {
	Hash    string
	Message string
}

Change represents a git commit

func ListChanges

func ListChanges(version string) []Change

ListChanges lists changes since the last version.

type ExecutionResult

type ExecutionResult struct {
	ExitCode int
	Stdout   string
	Stderr   string
	Error    error
}

ExecutionResult represents a command execution result

func Execute

func Execute(showOutput bool, cmd string, args ...string) (result ExecutionResult)

Execute executes a command.

func (ExecutionResult) Verify

func (e ExecutionResult) Verify(executableName, failureMessage string)

Verify checks the command executed properly and exited with exit code 0

Jump to

Keyboard shortcuts

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