diff options
| author | Fuwn <[email protected]> | 2024-10-12 12:14:11 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-12 12:14:11 +0000 |
| commit | 0c846980424a27e3be43fa505ca860f0d6e0bab2 (patch) | |
| tree | ff1e658e68d92e490468da030ed9b88524280347 /source.go | |
| parent | refactor(utilities): move lister to utilities (diff) | |
| download | yae-0c846980424a27e3be43fa505ca860f0d6e0bab2.tar.xz yae-0c846980424a27e3be43fa505ca860f0d6e0bab2.zip | |
refactor(source): move tag fetcher to members
Diffstat (limited to 'source.go')
| -rw-r--r-- | source.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -34,7 +34,7 @@ func (source *Source) Update(sources *Sources, name string, show bool, force boo } if source.Type == "git" { - tag, err := fetchLatestGitTag(*source, show) + tag, err := source.fetchLatestGitTag(show) if err != nil { return updated, err @@ -83,7 +83,7 @@ func (source *Source) Update(sources *Sources, name string, show bool, force boo return updated, nil } -func fetchLatestGitTag(source Source, show bool) (string, error) { +func (source *Source) fetchLatestGitTag(show bool) (string, error) { if source.Type == "git" { repository := "https://github.com/" + strings.Split(source.URL, "/")[3] + "/" + strings.Split(source.URL, "/")[4] remotes, err := command("bash", show, "-c", fmt.Sprintf("git ls-remote %s | awk -F'/' '{print $NF}' | sort -V", repository)) |