util

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutRepositoryTag added in v0.4.0

func CheckoutRepositoryTag(repo *git.Repository, tag string) error

CheckoutRepositoryTag checkouts a repository tag by looking for the tag reference then calling the checkout function.

Calling This function is equivalent to executing `git checkout tags/$tag`

func CloneRepository added in v0.4.0

func CloneRepository(ctx context.Context, path, repositoryURL string) error

CloneRepository clones a git repository into a given directory.

Calling his function is equivalent to executing `git clone $repositoryURL $path`

func CopyFile added in v0.4.0

func CopyFile(src, dest string) error

CopyFile copies a file from a source path to a destination path.

func FetchRepositoryTags added in v0.4.0

func FetchRepositoryTags(ctx context.Context, path string) error

FetchRepositoryTags fetches a repository remote tags.

Calling this function is equivalent to executing `git -C $path fetch --all --tags`

func FileExists added in v0.0.7

func FileExists(path string) bool

FileExists returns True if the supplied file path exists, false otherwise

func InStrings

func InStrings(subject string, collection []string) bool

InStrings returns true if the subject string is contained in the supplied slice of strings

func LoadRepository added in v0.4.0

func LoadRepository(path string) (*git.Repository, error)

LoadRepository loads a repository from the local file system. TODO(a-hilaly): load repository into a memory filesystem (needs go1.16 migration or use somethign like https://github.com/spf13/afero

Types

This section is empty.

Jump to

Keyboard shortcuts

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