shutil

package
v1.10.5 Latest Latest
Warning

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

Go to latest
Published: Jul 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 CmdRan

func CmdRan(err error) bool

func Exec

func Exec(env map[string]string, stdout, stderr io.Writer, cmd string, args ...string) (ran bool, err error)

Copied from mage

func ExitStatus

func ExitStatus(err error) int

ExitStatus returns the exit status of the error if it is an exec.ExitError or if it implements ExitStatus() int. 0 if it is nil or 1 if it is a different error.

func Output

func Output(cmd string, args ...string) (string, error)

Returns output from stdout. stderr gets used as normal here

func OutputPanic

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

Returns output from stdout, and panics on error stderr gets used as normal here

func OutputWithEnv

func OutputWithEnv(env map[string]string, cmd string, args ...string) (string, error)

func OutputWithEnvWithInput

func OutputWithEnvWithInput(env map[string]string, cmd string, in string, args ...string) (string, error)

func OutputWithInput

func OutputWithInput(cmd string, in string, args ...string) (string, error)

func Run

func Run(cmd string, args ...string) error

Run command.

If mage is run with -v flag, stdout will be used to print output, if not, output will be hidden. Stderr will work as normal

func RunPanic

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

Run command.

If mage is run with -v flag, stdout will be used to print output, if not, output will be hidden. Stderr will work as normal Will automatically panic on error

func RunV

func RunV(cmd string, args ...string) error

Run command and print any output to stdout/stderr

func RunVCapture

func RunVCapture(cmd string, args ...string) (string, string, error)

Run command and print any output to stdout/stderr Also return stdout/stderr as strings

func RunVPanic

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

Run command and print any output to stdout/stderr Will automatically panic on error

func RunVPanicWithEnv

func RunVPanicWithEnv(env map[string]string, cmd string, args ...string)

func RunVWithEnv

func RunVWithEnv(env map[string]string, cmd string, args ...string) error

func RunVWithEnvWithInput

func RunVWithEnvWithInput(env map[string]string, cmd string, in string, args ...string) error

func RunVWithInput

func RunVWithInput(cmd string, in string, args ...string) error

func RunWithEnv

func RunWithEnv(env map[string]string, cmd string, args ...string) error

func RunWithEnvWithInput

func RunWithEnvWithInput(env map[string]string, cmd string, in string, args ...string) error

func RunWithInput

func RunWithInput(cmd string, in string, args ...string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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