Documentation ¶
Index ¶
- func CreateEmptyDirectory(dir string) error
- func DoesDirectoryExist(dirPath string) (bool, error)
- func DoesFileExist(filePath string) (bool, error)
- func DoesStringArrayContain(strings []string, targetString string) bool
- func GetHomeDirectory() (string, error)
- func GetSubdirectories(dirPath string) (result []string, err error)
- func IsEmptyFile(filePath string) (bool, error)
- func JoinStringMaps(maps ...map[string]string) map[string]string
- func JoinStringSlices(slices ...[]string) []string
- func MakeDirectory(dir string) error
- func Merge(map1 map[string]string, map2 map[string]string)
- func MoveDirectory(srcPath, destPath string) error
- func NormalizeDockerComposeLog(line string) string
- func ParseCommand(command string) ([]string, error)
- func ParseDockerComposeLog(role, line string) (string, string)
- func PrintCommandFooter(writer io.Writer, elapsedTime fmt.Stringer)
- func PrintCommandHeader(writer io.Writer, text, dir string, env []string)
- func PrintSectionHeader(writer io.Writer, text string)
- func PrintSectionHeaderf(writer io.Writer, format string, a ...interface{})
- func Run(dir string, commandWords ...string) (string, error)
- func RunAndPipe(dir string, env []string, writer io.Writer, commandWords ...string) error
- func RunSeries(dir string, commands [][]string) error
- func StringifyKeysMapValue(v interface{}) interface{}
- func Strip(regex, text string) string
- func ToSnake(in string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEmptyDirectory ¶
CreateEmptyDirectory creates an empty dir directory and returns an error if any
func DoesDirectoryExist ¶
DoesDirectoryExist returns true if the directory dirPath is an existing directory, and false otherwise
func DoesFileExist ¶
DoesFileExist returns true if the file filePath exists, and false otherwise
func DoesStringArrayContain ¶
DoesStringArrayContain returns whether the given string slice contains the given string.
func GetHomeDirectory ¶
GetHomeDirectory returns the path to the user's home directory
func GetSubdirectories ¶
GetSubdirectories returns a slice of subdirectories in the directory dirPath
func IsEmptyFile ¶
IsEmptyFile returns true if filePath is an empty file, and false otherwise
func JoinStringMaps ¶
JoinStringMaps joins the given string maps
func JoinStringSlices ¶
JoinStringSlices joins the given slices
func MakeDirectory ¶ added in v0.29.0
MakeDirectory creates a directory dir if it doesn't already exist, returns an error if any
func MoveDirectory ¶
MoveDirectory moves srcPath to destPath
func NormalizeDockerComposeLog ¶
NormalizeDockerComposeLog removes colors, control characters, and converts carriage returns to newlines
func ParseCommand ¶
ParseCommand parses the command string into a string array
func ParseDockerComposeLog ¶
ParseDockerComposeLog parses the given docker-compose output and returns the service name and service output
func PrintCommandFooter ¶ added in v0.29.0
PrintCommandFooter prints the time elapsed since startTime
func PrintCommandHeader ¶ added in v0.29.0
PrintCommandHeader prints a command header
func PrintSectionHeader ¶ added in v0.29.0
PrintSectionHeader prints a section header
func PrintSectionHeaderf ¶ added in v0.29.0
PrintSectionHeaderf prints a section header with given format
func Run ¶
Run runs the given command, waits for the process to finish and returns the output string and error (if any)
func RunAndPipe ¶ added in v0.29.0
RunAndPipe runs the given command, and logs the process to the given writer
func StringifyKeysMapValue ¶ added in v0.33.0
func StringifyKeysMapValue(v interface{}) interface{}
StringifyKeysMapValue recurses into v and changes all instances of map[interface{}]interface{} to map[string]interface{}. This is useful to work around the impedence mismatch between JSON and YAML unmarshaling that's described here:
Types ¶
This section is empty.