Documentation
¶
Index ¶
- Variables
- func AskConfirmation(s string) (ret bool)
- func CombinedOutput(cmd string, args ...string) (string, error)
- func CombinedOutputCmd(cmd string, args ...string) func(args ...string) (string, error)
- func CombinedOutputWith(env map[string]string, cmd string, args ...string) (string, error)
- func Exec(env map[string]string, stdout, stderr io.Writer, cmd string, args ...string) (ran bool, err error)
- func ExitStatus(err error) int
- func FormatArgs(args []string) string
- func Get() string
- func GetHomeDir() string
- func GetHomeShortcutString() string
- func GetShortcutString() string
- func HomeDirKey() string
- func Key() string
- func Output(cmd string, args ...string) (string, error)
- func OutputCmd(cmd string, args ...string) func(args ...string) (string, error)
- func OutputWith(env map[string]string, cmd string, args ...string) (string, error)
- func Run(cmd string, args ...string) error
- func RunCmd(cmd string, args ...string) func(args ...string) error
- func RunWith(env map[string]string, cmd string, args ...string) error
Constants ¶
This section is empty.
Variables ¶
var ( // Stdout writer Stdout io.Writer = os.Stdout // Stderr writer Stderr io.Writer = os.Stderr // Stdin reader Stdin io.Reader = os.Stdin )
var ( // HomeDir of the current user. HomeDir = GetHomeDir() )
Functions ¶
func CombinedOutput ¶
CombinedOutput runs the command and returns the text from stdout and stderr.
func CombinedOutputCmd ¶
CombinedOutputCmd uses CombinedOutput and Exec underneath.
func CombinedOutputWith ¶
CombinedOutputWith is like RunWith, ubt returns what is written to stdout. and stderr
func Exec ¶
func Exec(env map[string]string, stdout, stderr io.Writer, cmd string, args ...string) (ran bool, err error)
Exec executes the command.
func ExitStatus ¶
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 FormatArgs ¶
FormatArgs formats command line aruments to a single string.
func GetHomeDir ¶
func GetHomeDir() string
GetHomeDir returns the current user home directory. docker/pkg/homedir.Get()
func GetHomeShortcutString ¶
func GetHomeShortcutString() string
GetHomeShortcutString for the home directory. docker/pkg/homedir.GetShortcutString()
func GetShortcutString ¶
func GetShortcutString() string
GetShortcutString returns the variable to use in the native shell.
func HomeDirKey ¶
func HomeDirKey() string
HomeDirKey returns the env var name for the user's home directory. docker/pkg/homedir.Key()
func OutputWith ¶
OutputWith is like RunWith, ubt returns what is written to stdout.
Types ¶
This section is empty.