Expand description
Resolve a user-supplied source spec into a staged plugin directory.
Adapted from strykelang’s pkg/resolver.rs, trimmed to the three source
forms zshrs plugins ship as (no semver/registry graph — global model).
Source forms accepted by znative add <SOURCE>:
owner/repoorgithub:owner/repo→git clone https://github.com/owner/repogit+URL, or any URL ending in.git→git clone URLpath:DIR, an absolute path, or./rel,../rel→ a local directory
@REF may be appended to a git/github source to pin a branch/tag/commit
(owner/repo@v1.2.0). The resolver clones into $ZSHRS_HOME/pkg/git/ and
returns the working tree; the caller copies the loadable subset into the
content-addressed store.
Structs§
- Staged
- A staged source ready to install into the store.
Functions§
- resolve
- Resolve
specinto aStagedtree. Clones (git/github) land understore.git_dir(); local paths are used in place. - source_
label - The provenance label a
specWOULD receive, computed WITHOUT cloning or network access. Used byznative load <spec>to check whether a source is already installed (the index keys on this label, since a repo’s basename often differs from itsznative.tomlplugin name — e.g.zshrs-forgit→forgit). ReturnsNonefor a bare plugin name (not a source form).