aboutsummaryrefslogtreecommitdiff
path: root/source.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-12 12:14:11 +0000
committerFuwn <[email protected]>2024-10-12 12:14:11 +0000
commit0c846980424a27e3be43fa505ca860f0d6e0bab2 (patch)
treeff1e658e68d92e490468da030ed9b88524280347 /source.go
parentrefactor(utilities): move lister to utilities (diff)
downloadyae-0c846980424a27e3be43fa505ca860f0d6e0bab2.tar.xz
yae-0c846980424a27e3be43fa505ca860f0d6e0bab2.zip
refactor(source): move tag fetcher to members
Diffstat (limited to 'source.go')
-rw-r--r--source.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/source.go b/source.go
index d1e5f4a..fe93da9 100644
--- a/source.go
+++ b/source.go
@@ -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))