Documentation ¶
Index ¶
- Variables
- func AppendToFile(filePath, content string) error
- func ChangeFileOwnership(filePath string, user *user.User) error
- func CreateDirAndChown(dirPath string, perm os.FileMode, user *user.User) error
- func FileExists(filePath string) bool
- func GetRepoNameFromConfig(path string) (string, error)
- func IsScriptPresent(filePath, script string) bool
- func SetupFS()
- func WriteFileAndChown(filePath string, content []byte, perm os.FileMode, user *user.User) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Fs afero.Fs
Fs is the global file system instance, can be backed by real FS or MemMapFs for testing.
Functions ¶
func AppendToFile ¶
AppendToFile appends content to a file
func ChangeFileOwnership ¶
ChangeFileOwnership changes the ownership of a file
func CreateDirAndChown ¶
CreateDirAndChown creates a directory and changes its ownership
func GetRepoNameFromConfig ¶
GetRepoNameFromConfig checks if the current directory (or any of its parent directories) is inside a Git repository. If inside a Git repo, it retrieves and returns the repository name.
func IsScriptPresent ¶
IsScriptPresent checks if a script is already present in a file
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.