CIScriptsHelpers

package
v0.0.0-...-c458722 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureCommand

func CaptureCommand(args ...string) (out []byte, err error)

func CheckBinary

func CheckBinary(name string) bool

func Command

func Command(args ...string) error

func ConfigFetch

func ConfigFetch(key string, defaultValue ...string) (value string, ok bool)

EnvFetch fetchs an environment variables. Sets the value to the default value if it does not exist.

func ConfigFetchWithDefault

func ConfigFetchWithDefault(key, defaultValue string) (value string)

func ConfigSetDefault

func ConfigSetDefault(key, value string)

ConfigCheck sets environment variable key to value if it is not already set. Used to set default env values

func CopyAndExpandFolder

func CopyAndExpandFolder(srcFolder, destFolder string) error

func ExpandPath

func ExpandPath(path string) string

func Filter

func Filter(vs []string, f func(string) bool) []string

func LogError

func LogError(s string, opt ...interface{})

LogInfo logs log line to terminal in red

func LogInfo

func LogInfo(s string, opt ...interface{})

LogInfo logs log line to terminal in blue

func LogSuccess

func LogSuccess(s string, opt ...interface{})

LogInfo logs log line to terminal in green

func LogWarning

func LogWarning(s string, opt ...interface{})

LogInfo logs log line to terminal in yellow

func ParseCLIArguments

func ParseCLIArguments()

func PrettyExit

func PrettyExit(code int, s string, opt ...interface{})

func RecursiveFilesInFolder

func RecursiveFilesInFolder(folder string) ([]string, error)

func RequiredConfigFetch

func RequiredConfigFetch(key string) (value string)

func RequiredConfigKey

func RequiredConfigKey(key string)

RequiredEnv ensures an environment variable is set. If it is not set, it will exit with status code 1

func RunCommand

func RunCommand(cmd *exec.Cmd) error

func TestCommand

func TestCommand(args ...string) bool

func TimedRun

func TimedRun(name string, function Run) error

Types

type Run

type Run func() error

Jump to

Keyboard shortcuts

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