Documentation
¶
Index ¶
- func FileExists(path string) bool
- func ParseDirectory(matches DirMatch, dir string) (isRoot bool, subdirs []string, stopErr error)
- func RandLowerChars(length int) string
- func Run(command ...string) (string, error)
- func RunInDir(directory string, command ...string) (stdoutText string, stderrText string, err error)
- func RunInDirWithStdin(directory string, input string, command ...string) (stdoutText string, stderrText string, err error)
- func TempDir() (string, error)
- type DirMatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
func ParseDirectory ¶ added in v0.2.0
ParseDirectory checks if `dir` fits a predicate `matches`. If it encounters an error it cannot proceed from, it returns `stopErr`. Otherwise, it returns all `subdirs` for the parent to recurse into.
func RandLowerChars ¶
func Run ¶
Run is a no muss, no fuss way to run a command in a shell. Deprecated: use RunInDir() instead
func RunInDir ¶ added in v0.2.0
func RunInDir(directory string, command ...string) (stdoutText string, stderrText string, err error)
RunInDir runs `command` from `directory`, and returns any text from the `command` or `err` that occurred.
func RunInDirWithStdin ¶ added in v0.4.0
func RunInDirWithStdin(directory string, input string, command ...string) (stdoutText string, stderrText string, err error)
RunInDirWithStdin runs `command` from `directory`, passing the string `input` to stdin, and returns any text from the `command` or `err` that occurred.
Types ¶
Click to show internal directories.
Click to hide internal directories.