utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinExists

func BinExists(name string) bool

BinExists is a helper function which checks if a given binary exists somewhere on the PATH.

func GetCommit

func GetCommit() (string, error)

GetCommit gets the latest short commit hash.

func GetGitUserEmail

func GetGitUserEmail() (string, error)

GetGitUserEmail gets the email address of the git user, as specified in the git config.

func GetGitUserName

func GetGitUserName() (string, error)

GetGitUserName gets the name of the git user, as specified in the git config.

func GetTag

func GetTag() (string, error)

GetTag gets the latest git tag for a repository.

func InRepo

func InRepo() bool

InRepo checks whether the directory which chart-release is run from is a git repository.

func IsDirty

func IsDirty() (bool, string)

IsDirty checks whether a repository is in a dirty state (has uncommitted changes).

func Normalize

func Normalize(output string) string

Normalize is a helper function which strips a given []byte of any return characters (\r\n).

func PrintDiff

func PrintDiff(out io.Writer, filename, old, new string)

PrintDiff writes a git-like diff to the supplied io.Writer.

func RunCommand

func RunCommand(name string, args ...string) (string, error)

RunCommand is a helper to run a command and collect the output from stdout and stderr.

Types

This section is empty.

Jump to

Keyboard shortcuts

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