Documentation ¶
Index ¶
- Constants
- Variables
- func CD(dir string) error
- func CopyFile(src, dst string, overwrite bool) error
- func FileExists(f string) (bool, error)
- func IsDir(f string) (bool, error)
- func IsRegFile(f string) (bool, error)
- func NoCheckCopyFile(src, dst string) error
- func Panik(e error, m string, args ...interface{})
- func Popd() error
- func Pushd(dir string) error
- func RemoveDir(dir string) (bool, error)
- func Run(exePath string, workDir string, args ...string) (int, error)
- func SameFile(a, b string) (bool, error)
- func Wrap(e error, m string, args ...interface{}) error
- type Go
Constants ¶
const ( EXIT_OK = 0 // Zero exit code EXIT_BAD = 1 // General error exit code )
Variables ¶
var WorkDirStack = []string{}
WorkDirStack is the working directory stack used by Pushd and Popd functions.
Functions ¶
func FileExists ¶
FileExists returns true if the file exists, false if not, and an error if file existence could not be determined.
func IsDir ¶
IsDir returns true if the file exists and is a directory. An error is returned if this could not be determined.
func IsRegFile ¶
IsRegFile returns true if the file exists and is a regular file. An error is returned if this could not be determined.
func NoCheckCopyFile ¶
NoCheckCopyFile copies the single file 'src' to 'dst' and doesn't make any attempt to check the file paths before hand.
func Panik ¶
Panik prints the error before exiting with code 1. It does not generate a Go panic but simulates one without propagation or printing the call stack, sorry for any confusion. Wraps 'e' with another error containing the format message 'm' if 'm' is not empty.
func RemoveDir ¶
RemoveDir recursively removes directory 'dir'. If something was removed then true is returned rather than an error.
func Run ¶
Run runs the executable at 'exePath'. Setting the 'workDir' as empty will use the default as specified by functions that accept exec.Cmd. EXIT_OK is returned on successful execution otherwise EXIT_BAD or another non-zero exit code is returned.