subprocess

package
v0.0.0-...-7f4ff7b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(cmd *gocmd.Cmd) string

Types

type ExecHelper

type ExecHelper struct {
	Log logr.Logger
}

ExecHelper is a wrapper for executing shell commands.

TODO(jeremy): Should we get rid of the methods that don't use "github.com/go-cmd/cmd" i.e RunCommands, Run, and RunQuietly? Should we refactor them so we use go-cmd.Cmd everywhere?

func (*ExecHelper) RunStreaming

func (h *ExecHelper) RunStreaming(cmd *gocmd.Cmd, w io.Writer) <-chan gocmd.Status

RunStreaming executes a command asynchronously and streams the stdout and stderr to the writer.

Important: There is no guarantee that stdout and stderr will be written in the same order in which they are invoked due to buffering.

The cmd must have streaming enabled; e.g. it can be created using NewCmdOptions and setting the streaming option to true.

Jump to

Keyboard shortcuts

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