Documentation
¶
Index ¶
- func CopyFile(src, dst string) error
- func CreateDirectory(dir string)
- func DirectoryExists(dir string) bool
- func FileContainsString(file string, str string) bool
- func FileExists(filename string) bool
- func FindFilesByExtension(directory string, extensions []string) ([]string, error)
- func GetExecutionDirectory() string
- func GetFileBytes(file string) ([]byte, error)
- func GetFileContent(file string) (string, error)
- func GetPathRelativeToDirectory(currentDirectory string, rootDirectory string) string
- func GetProjectDirectory() (string, error)
- func GetWorkingDirectory() string
- func MoveFile(oldLocation string, newLocation string) error
- func RemoveFile(file string) error
- func SaveFileText(file string, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirectory ¶
func CreateDirectory(dir string)
CreateDirectory creates a new folder if not present, ignores errors
func DirectoryExists ¶
DirectoryExists checks if the dir exists
func FileContainsString ¶
FileContainsString will check if a file contains the string
func FindFilesByExtension ¶
FindFilesByExtension will return all files with a specific extension in a directory
func GetExecutionDirectory ¶
func GetExecutionDirectory() string
GetExecutionDirectory returns the execution directory
func GetFileBytes ¶
GetFileBytes will retrieve the content of a file as bytes
func GetFileContent ¶
GetFileContent will retrieve the content of a file as text
func GetPathRelativeToDirectory ¶
GetPathRelativeToDirectory returns the relative path in relation to the rootDirectory
func GetProjectDirectory ¶
GetProjectDirectory will try to find the project directory based on repository folders (.git)
func GetWorkingDirectory ¶
func GetWorkingDirectory() string
GetWorkingDirectory returns the current working directory
func SaveFileText ¶
SaveFileText will save a file with the provided content
Types ¶
This section is empty.