Documentation ¶
Index ¶
- Constants
- Variables
- func AbsolutizePaths(files []string) ([]string, error)
- func AppendIfNotPresent(target []string, elements ...string) []string
- func CopyDir(src string, dst string, extensions []string) (err error)
- func CopyFile(src, dst string) (err error)
- func ExecCommand(ctx *types.Context, command *exec.Cmd, stdout int, stderr int) ([]byte, []byte, error)
- func FilterDirs(files []os.FileInfo) []os.FileInfo
- func FilterFiles() filterFiles
- func FilterFilesWithExtensions(extensions ...string) filterFiles
- func FilterOutSCCS(file *paths.Path) bool
- func FilterReadableFiles(file *paths.Path) bool
- func FindFilesInFolder(dir *paths.Path, recurse bool, extensions []string) (paths.PathList, error)
- func IsHiddenFile(file os.FileInfo) bool
- func IsSCCSFile(file os.FileInfo) bool
- func IsSCCSOrHiddenFile(file os.FileInfo) bool
- func LogIfVerbose(warn bool, msg string) types.Command
- func MD5Sum(data []byte) string
- func NormalizeUTF8(buf []byte) []byte
- func PrintableCommand(parts []string) string
- func ReadDirFiltered(folder string, fn filterFiles) ([]os.FileInfo, error)
- func WrapWithHyphenI(value string) string
Constants ¶
const ( Ignore = 0 // Redirect to null Show = 1 // Show on stdout/stderr as normal ShowIfVerbose = 2 // Show if verbose is set, Ignore otherwise Capture = 3 // Capture into buffer )
Variables ¶
var FilterOutHiddenFiles = paths.FilterOutPrefixes(".")
FilterOutHiddenFiles is a ReadDirFilter that exclude files with a "." prefix in their name
Functions ¶
func AbsolutizePaths ¶
func AppendIfNotPresent ¶
func CopyDir ¶
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.
func CopyFile ¶
CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.
func ExecCommand ¶
func FilterFiles ¶
func FilterFiles() filterFiles
func FilterFilesWithExtensions ¶
func FilterFilesWithExtensions(extensions ...string) filterFiles
func FilterOutSCCS ¶
FilterOutSCCS is a ReadDirFilter that excludes known VSC or project files
func FilterReadableFiles ¶
FilterReadableFiles is a ReadDirFilter that accepts only readable files
func FindFilesInFolder ¶
func IsHiddenFile ¶
func IsSCCSFile ¶
func IsSCCSOrHiddenFile ¶
func NormalizeUTF8 ¶
Normalizes an UTF8 byte slice TODO: use it more often troughout all the project (maybe on logger interface?)
func PrintableCommand ¶
Convert a command and argument slice back to a printable string. This adds basic escaping which is sufficient for debug output, but probably not for shell interpretation. This essentially reverses ParseCommandLine.
func WrapWithHyphenI ¶
Types ¶
This section is empty.