Documentation
¶
Index ¶
- func Cd(dir string)
- func Contains(file, substr string) bool
- func Cwd() string
- func Delete(path string)
- func EnsureDir(dir string)
- func Exists(file string) bool
- func Find(glob string) string
- func FindAll(glob string) []string
- func FindParent(dir string, glob string) string
- func Fingerprint(globs ...string) string
- func InDir(dir string, run func())
- func InTempDir(fn func())
- func IsDir(dir string) bool
- func IsRegular(name string) bool
- func JoinPaths(paths ...string) string
- func LogWorkdir()
- func Ls(dir string) string
- func Read(file string) string
- func Require(file string)
- func Sha256Hash(file string) string
- func WithTempDir(fn func(dir string))
- func Write(path, contents string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cd ¶
func Cd(dir string)
Cd changes the current working directory to the provided relative or absolute directory
func Delete ¶
func Delete(path string)
Delete removes the given file or directory, first verifying it is a subdirectory of RootDir
func EnsureDir ¶
func EnsureDir(dir string)
EnsureDir checks if the directory exists. create if not, including any subdirectories needed
func Exists ¶
Exists indicates a file of any type (regular, directory, symlink, etc.) exists and is readable
func FindParent ¶
FindParent finds the first matching file in the specified directory or any parent directory
func Fingerprint ¶
Fingerprint hashes all files and provides a stable hash of all the contents
func InDir ¶
func InDir(dir string, run func())
InDir executes the given function in the provided directory, returning to the current working directory upon completion
func InTempDir ¶
func InTempDir(fn func())
InTempDir executes with the current working directory in a new temporary directory, restoring cwd and removing all contents of the temp directory upon completion
func IsRegular ¶
IsRegular indicates the provided file exists and is a regular file, not a directory or symlink
func LogWorkdir ¶
func LogWorkdir()
func Sha256Hash ¶
func WithTempDir ¶
func WithTempDir(fn func(dir string))
WithTempDir creates a temporary directory, provided for the duration of the function call, removing all contents upon completion
Types ¶
This section is empty.