s

package
v2.0.0-...-c98e9ca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Output     io.Writer = io.Discard
	IndentSize int
)

Functions

func CD

func CD(dir string)

func COPY

func COPY(source string, target string)

COPY file from source to target

func COPYDIR

func COPYDIR(src string, dst string)

COPYDIR recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped. Credit: https://gist.github.com/r0l1/92462b38df26839a3ca324697c8cba04

func CWD

func CWD() string

func DELETE

func DELETE(filename string)

DELETE a file.

func ECHO

func ECHO(message string)

func ENDIR

func ENDIR(path string, mode ...os.FileMode)

ENDIR ensures that the path gets created if it doesn't exist

func EXEC

func EXEC(command string)

func EXISTS

func EXISTS(path string) bool

EXISTS - Returns true if the given path exists

func ISDIR

func ISDIR(path string) bool

ISDIR returns true if the given directory exists

func ISDIREMPTY

func ISDIREMPTY(dir string) bool

ISDIREMPTY returns true if the given directory is empty

func ISFILE

func ISFILE(path string) bool

ISFILE returns true if the given file exists

func LOADBYTES

func LOADBYTES(filename string) []byte

LOADBYTES returns the contents of the given filename as a string

func LOADSTRING

func LOADSTRING(filename string) string

LOADSTRING returns the contents of the given filename as a string

func MD5FILE

func MD5FILE(filename string) string

MD5FILE returns the md5sum of the given file

func MKDIR

func MKDIR(path string, mode ...os.FileMode)

func MUSTDELETE

func MUSTDELETE(filename string)

MUSTDELETE a file.

func RENAME

func RENAME(source string, target string)

RENAME a file or directory

func REPLACEALL

func REPLACEALL(filename string, substitutions Sub)

REPLACEALL replaces all substitution keys with associated values in the given file

func RM

func RM(target string)

func RMDIR

func RMDIR(target string)

func SAVEBYTES

func SAVEBYTES(filename string, data []byte)

SAVEBYTES will create a file with the given string

func SAVESTRING

func SAVESTRING(filename string, data string)

SAVESTRING will create a file with the given string

func SUBDIRS

func SUBDIRS(rootDir string) []string

SUBDIRS returns a list of subdirectories for the given directory

func TOUCH

func TOUCH(filepath string)

Types

type Sub

type Sub map[string]string

Sub is the substitution type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL