utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteShellCommand

func ExecuteShellCommand(ctx context.Context, command string, args []string, options ExecOptions) error

func FileExists

func FileExists(filename string) bool

func GetSystemDir

func GetSystemDir() string

func PrintError

func PrintError(err error)

PrintError prints errors to std.Output

func PrintErrorToStdError

func PrintErrorToStdError(err error)

PrintErrorToStdError prints errors to std.Error

func PrintErrorToStdErrorAndExit

func PrintErrorToStdErrorAndExit(err error)

PrintErrorToStdErrorAndExit prints errors to std.Error and exits with an error code

func PrintOrWriteToFile

func PrintOrWriteToFile(format string, filePath string, data any, fileMode os.FileMode) error

PrintOrWriteToFile converts the provided value to given format and writes it to the specified file

func ProcessTemplate

func ProcessTemplate(s string, vars map[string]any) (string, error)

func StringInSlice

func StringInSlice(a string, list []string) bool

Types

type ExecOptions

type ExecOptions struct {
	DryRun           bool
	Env              []string
	WorkingDirectory string
	StdOut           io.Writer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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