exec

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdResult added in v0.9.1

func CmdResult(cmd string, args ...string) string

CmdResult always returns an informative description of what command ran and what the outcome (stdout+stderr, exit code if any) was. Logging is left entirely to the caller.

func Run

func Run(ctx context.Context, cmd *exec.Cmd) (string, error)

Run does the same as RunCommand but takes a pre-populated cmd. Stdout and stderr are ignored and replaced with the output handling described for RunCommand.

func RunCommand

func RunCommand(ctx context.Context, cmd string, args ...string) (string, error)

RunCommand executes the command with logging through klog, with output processed line-by-line with the command path as prefix. It returns the combined output and, if there was a problem, includes that output and the command in the error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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