Documentation ¶
Index ¶
- func Append(path string, contents string)
- func AppendBytes(path string, b []byte)
- func AppendBytesErr(path string, b []byte) error
- func AppendErr(path string, contents string) error
- func Appendf(path string, format string, args ...interface{})
- func Ask(msg string) string
- func Askf(format string, args ...interface{}) string
- func Chdir(dir string)
- func Echo(str string)
- func Echof(format string, args ...interface{})
- func ExeName(path string) string
- func Exists(path string) bool
- func Getwd() string
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsVerbose() bool
- func MkdirAll(dir string)
- func PopEchoFilter()
- func PushEchoFilter(str string)
- func Read(path string) string
- func ReadErr(path string) (string, error)
- func ReadFile(path string) []byte
- func Remove(dir string)
- func RemoveAll(dir string)
- func ScanLine() string
- func ScanLineErr() (string, error)
- func SetColorsEnabled(enabled bool)
- func SetErrorHandler(fnErr func(err error))
- func SetStderr(w io.Writer)
- func SetStdin(r io.Reader)
- func SetStdout(w io.Writer)
- func SetVerbose(b bool)
- func SetVerboseEnvVarName(s string)
- func Stat(path string) fs.FileInfo
- func Verbose(str string)
- func Verbosef(format string, args ...interface{})
- func Warn(str string)
- func Warnf(format string, args ...interface{})
- func Write(path string, contents string)
- func WriteBytes(path string, b []byte)
- func WriteBytesErr(path string, b []byte) error
- func WriteErr(path string, contents string) error
- func Writef(path string, format string, args ...interface{})
- type Command
- func (c *Command) Bash()
- func (c *Command) BashErr() error
- func (c *Command) BashExitStatus() int
- func (c *Command) BashStr() string
- func (c *Command) Env(vars ...string) *Command
- func (c *Command) Err(out io.Writer) *Command
- func (c *Command) ExitStatus(n *int) *Command
- func (c *Command) ExpandEnv() *Command
- func (c *Command) In(in io.Reader) *Command
- func (c *Command) Out(out io.Writer) *Command
- func (c *Command) OutErr(out io.Writer) *Command
- func (c *Command) Run()
- func (c *Command) RunErr() error
- func (c *Command) RunExitStatus() int
- func (c *Command) RunStr() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendBytes ¶
func AppendBytesErr ¶
func PopEchoFilter ¶
func PopEchoFilter()
func PushEchoFilter ¶
func PushEchoFilter(str string)
func ScanLineErr ¶
func SetColorsEnabled ¶ added in v0.1.4
func SetColorsEnabled(enabled bool)
func SetErrorHandler ¶
func SetErrorHandler(fnErr func(err error))
SetErrorHandler sets the behavior when an error is encountered while running most commands. The default behavior is to panic.
func SetVerbose ¶ added in v0.1.3
func SetVerbose(b bool)
func SetVerboseEnvVarName ¶ added in v0.1.3
func SetVerboseEnvVarName(s string)
SetVerboseEnvVarName allows changing the name of the environment variable that is used to decide if we are in Verbose mode. This function creates the new env var immediately, setting its value to true or false based on the value of the old env var name.
func WriteBytes ¶
func WriteBytesErr ¶
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func (*Command) BashExitStatus ¶
func (*Command) Env ¶
Env adds environment variables in the form "KEY=VALUE", to be set on exec.Cmd.Env. Note: these env vars are not seen by ExpandEnv.
func (*Command) ExitStatus ¶
func (*Command) ExpandEnv ¶
ExpandEnv calls os.ExpandEnv on the command string before it is parsed and passed to exec.Cmd.
func (*Command) RunExitStatus ¶
Click to show internal directories.
Click to hide internal directories.