Skip to main content

latest_tag

Function latest_tag 

Source
pub fn latest_tag(
    repo_path: &Path,
    scope_name: &str,
) -> Result<Option<String>, GitSourceError>
Expand description

获取指定 scope 的最新 tag,标准化后返回。

scope 匹配规则:

  • cli/v0.1.0 → scope cli 匹配,返回 0.1.0
  • v0.1.0(无前缀)→ 任何 scope 都不匹配,仅在 scope 无专属 tag 时作为兜底
  • 使用 semver 排序,修复字符串排序 v10 < v9 的问题