exec

package
v0.0.0-...-a27e3f8 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cmd string, out io.Writer, env ...string) (string, error)

Run runs a command, outputting to terminal and returning the full output and/or error.

func RunInDir

func RunInDir(cmd, dir string, out io.Writer, env ...string) (string, error)

RunInDir runs a command in the specified directory and returns the full output or error.

func RunSilent

func RunSilent(cmd string, dir string, env ...string) (string, error)

RunSilent runs a command without printing to stdout and returns the full output or error.

Types

type PrefixWriter

type PrefixWriter struct {
	// contains filtered or unexported fields
}

PrefixWriter writes each line written into it to `out` prefixed with `prefix | `

func NewPrefixWriter

func NewPrefixWriter(prefix string, out io.Writer) *PrefixWriter

NewPrefixWriter creates a new PrefixWriter

func (*PrefixWriter) Write

func (p *PrefixWriter) Write(in []byte) (int, error)

Write takes input bytes and seperates it into lines, writing each to `out`

Jump to

Keyboard shortcuts

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