Documentation
¶
Index ¶
- Constants
- func AddGitignoreMarkerBlock(repoPath string, patterns []string) ([]string, error)
- func AddToGitignore(repoPath, pattern string, location config.ComponentMode) (bool, error)
- func CreateSymlink(target, linkPath string) error
- func EnsureDir(path string) error
- func Exists(path string) bool
- func ExistsNoFollow(path string) bool
- func GetGitignoreMarkerPatterns(repoPath string) []string
- func HasGitignoreMarkerBlock(repoPath string) bool
- func IsDir(path string) bool
- func IsDirNoFollow(path string) bool
- func IsSymlink(path string) bool
- func RemoveAll(path string) error
- func RemoveFromGitignore(repoPath, pattern string, location config.ComponentMode) (bool, error)
- func RemoveGitignoreMarkerBlock(repoPath string) ([]string, error)
- func ResolveSymlink(path string) (string, error)
- func SymlinkTarget(path string) (string, error)
Constants ¶
const ( // GitignoreMarkerStart is the start marker for thts-managed gitignore patterns. GitignoreMarkerStart = "# thts-agent-start" // GitignoreMarkerEnd is the end marker for thts-managed gitignore patterns. GitignoreMarkerEnd = "# thts-agent-end" )
Gitignore marker constants.
Variables ¶
This section is empty.
Functions ¶
func AddGitignoreMarkerBlock ¶ added in v0.2.0
AddGitignoreMarkerBlock adds patterns between markers in the gitignore file. If a marker block already exists, it updates the patterns within it. Returns the list of patterns that were added.
func AddToGitignore ¶
func AddToGitignore(repoPath, pattern string, location config.ComponentMode) (bool, error)
AddToGitignore adds a pattern to the appropriate gitignore file. Returns true if the pattern was added, false if it already existed or was disabled.
func CreateSymlink ¶
CreateSymlink creates a symbolic link at linkPath pointing to target. If linkPath already exists, it returns an error.
func ExistsNoFollow ¶
ExistsNoFollow returns true if the path exists (does not follow symlinks).
func GetGitignoreMarkerPatterns ¶ added in v0.2.0
GetGitignoreMarkerPatterns returns the patterns in the marker block.
func HasGitignoreMarkerBlock ¶ added in v0.2.0
HasGitignoreMarkerBlock checks if the gitignore file has a thts marker block.
func IsDirNoFollow ¶
IsDirNoFollow returns true if the path is a directory (does not follow symlinks).
func RemoveAll ¶
RemoveAll removes path and any children it contains. It handles permission issues with special directories like searchable/.
func RemoveFromGitignore ¶
func RemoveFromGitignore(repoPath, pattern string, location config.ComponentMode) (bool, error)
RemoveFromGitignore removes a pattern from the gitignore file. Returns true if the pattern was removed.
func RemoveGitignoreMarkerBlock ¶ added in v0.2.0
RemoveGitignoreMarkerBlock removes the marker block from the gitignore file. Returns the patterns that were removed.
func ResolveSymlink ¶
ResolveSymlink resolves a symbolic link to its final target (like realpath).
func SymlinkTarget ¶
SymlinkTarget returns the target of a symbolic link.
Types ¶
This section is empty.