helpers

package
v0.127.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigurationReadFailed = errors.New("failed to read configuration")

Functions

func ConsumeSubCommands

func ConsumeSubCommands(cmd *cobra.Command, subCommands []*cobra.Command) *cobra.Command

func EnvArgsToMap added in v0.19.0

func EnvArgsToMap(arguments []string) map[string]string

envArgsToMap parses and expands environment arguments like "A=B" (set operation) and "A" (pass-through operation) into a map suitable for use across the codebase.

func EnvFileToMap added in v0.98.0

func EnvFileToMap(envFilePath string) (map[string]string, error)

func EvaluateStarlarkConfig added in v0.19.0

func EvaluateStarlarkConfig(ctx context.Context, path string, env map[string]string) (string, error)

func GitDiff added in v0.64.0

func GitDiff(dir string, revision string, cached bool) ([]string, error)

GitDiff is a simplified "git diff" and "git diff --cached" implementation using go-git.

GitDiff closely resembles the implementation of go-git Worktree's Status() method.

func ReadCombinedConfig added in v0.19.0

func ReadCombinedConfig(ctx context.Context, env map[string]string) (string, error)

func ReadYAMLConfig added in v0.19.0

func ReadYAMLConfig(path string) (string, error)

Types

type ExitCodeError added in v0.118.0

type ExitCodeError struct {
	// contains filtered or unexported fields
}

func NewExitCodeError added in v0.118.0

func NewExitCodeError(exitCode int, err error) ExitCodeError

func (ExitCodeError) Error added in v0.118.0

func (exitCodeError ExitCodeError) Error() string

func (ExitCodeError) ExitCode added in v0.118.0

func (exitCodeError ExitCodeError) ExitCode() int

Jump to

Keyboard shortcuts

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