osutil

package
v1.28.16 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DEFAULT_STOP_FILE_NAME         = ".root_dir"
	ErrStopFileNotFoundWithinLimit = "stop file not found in any parent directory within search limit"
)

Variables

This section is empty.

Functions

func ExecCmd

func ExecCmd(l zerolog.Logger, command string) error

ExecCmd executes a command and logs the output

func ExecCmdWithContext

func ExecCmdWithContext(ctx context.Context, l zerolog.Logger, command string) error

ExecCmdWithContext executes a command with ctx and logs the output

func ExecCmdWithOptions

func ExecCmdWithOptions(ctx context.Context, l zerolog.Logger, command string, outputFunction func(string)) error

ExecCmdWithOptions executes a command with ctx and logs the output with a custom logging func

func FindDirectoriesContainingFile added in v1.28.3

func FindDirectoriesContainingFile(dir string, r *regexp.Regexp) ([]string, error)

FindDirectoriesContainingFile finds all directories containing a file matching the given regular expression

func FindFile added in v1.23.0

func FindFile(filename, stopFile string, limit int) (string, error)

FindFile looks for given file in the current directory and its parent directories first by locating top level parent folder where the search should begin (defined by stopFile, which cannot be located further "up" than limit parent folders) and then by searching from there for the file all subdirectories

func GetAbsoluteFolderPath added in v1.21.0

func GetAbsoluteFolderPath(folder string) (string, error)

func GetEnv

func GetEnv(key string) (string, error)

GetEnv returns the value of the environment variable named by the key and sets the environment variable up to be used in the remote runner

func SetupEnvVarsForRemoteRunner

func SetupEnvVarsForRemoteRunner(envVars []string) error

SetupEnvVarsForRemoteRunner sets up the environment variables in the list to propagate to the remote runner

Types

This section is empty.

Jump to

Keyboard shortcuts

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