utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskRemote

func AskRemote(remotes []*git.Remote) string

AskRemote ask to the user which remote repository yse

func GetPathParam

func GetPathParam(context *cli.Context) (string, error)

GetPathParam find path repository in command line arg or in the directory

func GetRemotePath

func GetRemotePath(remote string) string

GetRemotePath returns a string with the repo path for the given remote repository

func GetRemotes

func GetRemotes() []*git.Remote

GetRemotes returns an array with references to remote repositories

func IsGitRepository

func IsGitRepository() bool

IsGitRepository returns true if the current working directory is a valid git repository

func ReadInt

func ReadInt() int

ReadInt get a int value from user input

func ReadLine

func ReadLine() string

ReadLine read text from stdin until break line

func ReadLineOptional

func ReadLineOptional(defaultValue string) string

ReadLineOptional read text from stdin until break line, if the input is empty, return a default value

func RepoCommits

func RepoCommits() object.CommitIter

RepoCommits return repository commits iterator

func RepoHead

func RepoHead() *plumbing.Reference

RepoHead return repository head reference

func RepoLastCommit

func RepoLastCommit() *object.Commit

RepoLastCommit return last commit in git repository

func Repository

func Repository() *git.Repository

Repository return current repository reference

func ShowSpinner

func ShowSpinner() *spinner.Spinner

ShowSpinner display and return spinner instance

func Ternary

func Ternary(condition bool, value1 interface{}, value2 interface{}) interface{}

Ternary simulate ternary operator

Types

This section is empty.

Jump to

Keyboard shortcuts

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