diff options
Diffstat (limited to 'yae.go')
| -rw-r--r-- | yae.go | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -252,7 +252,7 @@ func command(name string, show bool, args ...string) (string, error) { func fetchLatestGitTag(source Source, show bool) (string, error) { if source.Type == "git" { repository := "https://github.com/" + strings.Split(source.URI, "/")[3] + "/" + strings.Split(source.URI, "/")[4] - remotes, err := command("git", show, "ls-remote", "--tags", repository) + remotes, err := command("bash", show, "-c", fmt.Sprintf("git ls-remote --tags %s | awk -F'/' '{print $NF}' | sort -V", repository)) if err != nil { return "", err @@ -263,14 +263,10 @@ func fetchLatestGitTag(source Source, show bool) (string, error) { if source.TagPredicate == "" { latest = refs[len(refs)-2] - - if strings.Contains(latest, "refs/tags/") { - latest = strings.Split(latest, "/")[2] - } } else { for i := len(refs) - 2; i >= 0; i-- { if strings.Contains(refs[i], source.TagPredicate) { - latest = strings.Split(refs[i], "/")[2] + latest = refs[i] break } |