Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveCacheDir ¶
ResolveCacheDir determines the cache directory to use based on: 1. Explicit cacheDir parameter (highest priority) 2. PROMPT_SYNC_CACHE_DIR environment variable 3. Default: $HOME/.prompt-sync/repos
Types ¶
type Fetcher ¶
type Fetcher interface {
// Clone fetches a repository at the given ref and returns the local path.
// If already cached, it may return the existing path.
Clone(repoURL, ref string) (string, error)
// Update pulls the latest changes for a repository at the given ref.
// Returns error if the repo is not already cloned.
Update(repoURL, ref string) error
// CachedPath returns the local path for a cached repository, if it exists.
// The bool indicates whether the repo is cached.
CachedPath(repoURL, ref string) (string, bool)
// CloneOrUpdate fetches a repository at the given ref and returns the local path and commit hash.
// If already cached, it updates and returns the existing path.
CloneOrUpdate(repoURL, ref string) (path string, commit string, err error)
}
Fetcher defines the interface for Git repository operations. Implementations may use go-git, exec git, or other backends.
func NewExecFetcher ¶
NewExecFetcher creates a GitFetcher that shells out to system git.
func NewFetcher ¶
NewFetcher creates a new GitFetcher with the given options.
func NewFetcherWithBackend ¶
NewFetcherWithBackend creates a GitFetcher with the specified backend.
Click to show internal directories.
Click to hide internal directories.