Documentation
¶
Index ¶
- Variables
- func AddVersionPrefix(prefix string) string
- func GetLatestVersionTag(dir string, versionPrefix string) (string, error)
- func GetSubPath(dir string) (string, []string, error)
- func GetVersionPrefix(dir string) (string, error)
- func GetVersionTag(targetDir, commit, tagPrefix string) (string, error)
- func GetVersionTagAtHEAD(targetDir, tagPrefix string) (string, error)
- func ListTags(targetDir string, commit string) ([]string, error)
- func ListTagsAtHEAD(targetDir string) ([]string, error)
- func StripVersionPrefix(prefix string, tag string) string
Constants ¶
This section is empty.
Variables ¶
var ErrNoTag = fmt.Errorf("no tag found")
Functions ¶
func AddVersionPrefix ¶ added in v0.0.93
func GetLatestVersionTag ¶ added in v0.0.87
GetLatestVersionTag returns the latest version tag in the directory that has versionPrefix as prefix The basic name (part after stripping versionPrefix) should not contain "/" If versionPrefix is "", then the returned tag should not be nested (no "/" in it)
func GetVersionPrefix ¶ added in v0.0.93
func GetVersionTag ¶ added in v0.0.93
GetVersionTagAtHEAD checks if there's a version tag at HEAD in the target directory tagPrefix is an optional prefix for the tag (e.g., "path/to/submodule/" for nested modules) If tagPrefix is empty, it will match tags like "v0.0.87" If tagPrefix is provided, it will match tags like "path/to/submodule/v0.0.87"
func GetVersionTagAtHEAD ¶
func ListTags ¶ added in v0.0.93
ListTagsAtHEAD returns all tags pointing at HEAD in the target directory
func ListTagsAtHEAD ¶
func StripVersionPrefix ¶ added in v0.0.93
StripVersionPrefix strips the version prefix from a tag to get the clean version Examples:
- StripVersionPrefix("", "v1.2.3") -> "v1.2.3"
- StripVersionPrefix("submodule/", "submodule/v1.2.3") -> "v1.2.3"
- StripVersionPrefix("path/to/module/", "path/to/module/v2.0.0") -> "v2.0.0"
Types ¶
This section is empty.