shell

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StreamOutput sets streaming of output instead of buffering it when running gocmd.Cmd.
	StreamOutput = gocmd.Options{
		Buffered:  false,
		Streaming: true,
	}

	// BufferAndStreamOutput sets buffering and streaming of output when running gocmd.Cmd
	// Buffering lets easy inspection of outputs in tests through inspecting gocmd.Cmd.Status.Stdout/err slices.
	BufferAndStreamOutput = gocmd.Options{
		Buffered:  true,
		Streaming: true,
	}
)

Functions

func BinaryExists

func BinaryExists(binName, hint string) bool

BinaryExists ensures that binary with given name (binName) is available on the PATH. hint lets you customize the error message.

func CurrentDir

func CurrentDir() string

CurrentDir returns current directory from where binary is executed.

func RedirectStreams

func RedirectStreams(src *gocmd.Cmd, stdoutDest, stderrDest io.Writer)

RedirectStreams redirects Stdout and Stderr of the gocmd.Cmd process to passed io.Writers.

func Start

func Start(cmd *gocmd.Cmd, done chan gocmd.Status)

Start starts new process (gocmd) and wait until it's done. Status struct is then propagated back to done channel passed as argument.

Types

This section is empty.

Jump to

Keyboard shortcuts

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