Documentation
¶
Index ¶
- Variables
- func LatestMatchingVersion(repoURL, constraint string) (version, gitTag string, err error)
- func LatestTag(repoURL string) (version, gitTag string, err error)
- func ParseDepName(name string) (repoURL, subdir string)
- func TreeHash(dir string) (hash string, files []string, err error)
- type FetchResult
Constants ¶
This section is empty.
Variables ¶
var ErrNoSemverTags = errors.New("no semver tags found")
ErrNoSemverTags is returned by LatestTag when a repository has no semver tags.
Functions ¶
func LatestMatchingVersion ¶
LatestMatchingVersion queries the remote repo's git tags via git ls-remote and returns the highest version that satisfies constraint. Returns the bare version (e.g. "1.2.3") and the git tag/ref (e.g. "v1.2.3").
If constraint is a branch name (e.g. "main", "HEAD") rather than a semver constraint, it is resolved to the current HEAD SHA of that branch and used directly as the git ref. The returned version is the short SHA.
func LatestTag ¶
LatestTag returns the highest semver tag in repoURL, regardless of constraints. Returns the bare version (e.g. "1.2.3") and the git tag (e.g. "v1.2.3").
func ParseDepName ¶
ParseDepName splits a GitHub dep name into the repo root URL and subdirectory.
"github.com/owner/repo" → ("https://github.com/owner/repo", "")
"github.com/owner/repo/sub/dir" → ("https://github.com/owner/repo", "sub/dir")
"github.com/owner/repo/tree/<branch>/sub/dir" → ("https://github.com/owner/repo", "sub/dir")
Types ¶
type FetchResult ¶
type FetchResult struct {
TreeHash string // "sha256:<hex>"
Files []string // sorted relative file paths within the installed directory
}
FetchResult contains the computed tree hash and file list produced by Fetch.
func Fetch ¶
func Fetch(dep resolver.ResolvedDep, installDir string) (FetchResult, error)
Fetch installs the skill directory for dep into installDir using a shallow git sparse-checkout. If installDir already exists and its tree hash matches dep.TreeHash the install is skipped (idempotent).
Returns a FetchResult with the computed tree hash and sorted file list.