Documentation
¶
Index ¶
- func AppendToFile(path, content string) error
- func ChangeDir(dir string) error
- func CleanPath(path string) string
- func CopyFile(src, dst string) error
- func CreateDir(path string) error
- func CreateFile(path, content string) error
- func DeleteDir(path string) error
- func DeleteFile(path string) error
- func DirExists(path string) bool
- func EnsureDir(dir string) error
- func FileExists(path string) bool
- func GetAbsolutePath(path string) (string, error)
- func GetCurrentDir() (string, error)
- func GetDirName(path string) string
- func GetFileExt(path string) string
- func GetFileName(path string) string
- func GetFileSize(path string) (int64, error)
- func GetHomeDir() (string, error)
- func GetRelativePath(base, target string) (string, error)
- func IsEmpty(dir string) (bool, error)
- func IsExecutable(path string) bool
- func JoinPath(elements ...string) string
- func ListDirs(dir string) ([]string, error)
- func ListFiles(dir string) ([]string, error)
- func MakeExecutable(path string) error
- func ReadFile(path string) (string, error)
- func ReadLines(path string) ([]string, error)
- func ReplaceInFile(path, old, newVal string) error
- func RunCommand(name string, args ...string) error
- func RunCommandInDir(dir, name string, args ...string) error
- func RunCommandWithOutput(name string, args ...string) (string, error)
- func SanitizeFileName(name string) string
- func SplitPath(path string) (string, string)
- func ValidateModulePath(path string) error
- func ValidateProjectName(name string) error
- func WriteLines(path string, lines []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToFile ¶
AppendToFile appends content to a file
func CreateFile ¶
CreateFile creates a file with the given content
func GetAbsolutePath ¶
GetAbsolutePath returns the absolute path of a file
func GetCurrentDir ¶
GetCurrentDir returns the current working directory
func GetDirName ¶
GetDirName returns the directory component of a path
func GetFileName ¶
GetFileName returns the filename component of a path
func GetFileSize ¶
GetFileSize returns the size of a file in bytes
func GetRelativePath ¶
GetRelativePath returns the relative path from base to target
func ReplaceInFile ¶
ReplaceInFile replaces all occurrences of old with new in a file
func RunCommand ¶
RunCommand executes a shell command and returns an error if it fails
func RunCommandInDir ¶
RunCommandInDir executes a shell command in a specific directory
func RunCommandWithOutput ¶
RunCommandWithOutput executes a shell command and returns its output
func SanitizeFileName ¶
SanitizeFileName sanitizes a filename by removing invalid characters
func ValidateModulePath ¶
ValidateModulePath validates a Go module path
func ValidateProjectName ¶
ValidateProjectName validates a project name
func WriteLines ¶
WriteLines writes lines to a file
Types ¶
This section is empty.