Documentation ¶
Index ¶
- Constants
- Variables
- func DirSize(path string) (string, error)
- func DownloadFile(filepath string, url string) error
- func Execute(filename string, args ...string) (string, error)
- func ExecuteEx(filename string, directoryName string, environment bool, args ...string) (string, error)
- func ExecuteOutputWriter(r io.Reader)
- func FmtDuration(duration time.Duration) string
- func GetHome() (string, error)
- func MkDir(path string) error
- func Pwd() (string, error)
- func SedFile(filename string, regex string, newContent string)
- type Os
Constants ¶
View Source
const ( // Unknown OS was not detected Unknown = iota // Osx Os Osx // Linux Os Linux // Windows Os Windows )
View Source
const NewLine = "\n"
NewLine is a constant string representing a new line - platform dependent
Variables ¶
View Source
var ExecuteStreamingToStdout = false
ExecuteStreamingToStdout is used to silence command output in the ExecuteOutputWriter below
Functions ¶
func DownloadFile ¶
DownloadFile downloads the file at url and saves it to filepath
func ExecuteEx ¶
func ExecuteEx(filename string, directoryName string, environment bool, args ...string) (string, error)
ExecuteEx runs a command and allows to set its working directory or pass the user environment to the command
func ExecuteOutputWriter ¶
ExecuteOutputWriter is called the go routines above to stream to stdout TODO: parameterize output channel, etc
func FmtDuration ¶
FmtDuration formats a time.Duration into a human readable form
Types ¶
Click to show internal directories.
Click to hide internal directories.