From f4b2680d2be16d66ce105010fc2f598d47d25a77 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 12 Oct 2024 13:50:10 +0000 Subject: feat(yae): hide internal tool logs --- source.go | 8 ++++---- utilities.go | 4 ++-- yae.go | 6 +----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/source.go b/source.go index 8be63d0..bd3661c 100644 --- a/source.go +++ b/source.go @@ -36,7 +36,7 @@ func (source *Source) Update(sources *Sources, name string, show bool, force boo } if source.Type == "git" { - tag, err := source.fetchLatestGitTag(show) + tag, err := source.fetchLatestGitTag() if err != nil { return updated, err @@ -65,7 +65,7 @@ func (source *Source) Update(sources *Sources, name string, show bool, force boo } } - sha256, err := fetchSHA256(source.URL, source.Unpack, show) + sha256, err := fetchSHA256(source.URL, source.Unpack) if err != nil { return updated, err @@ -85,10 +85,10 @@ func (source *Source) Update(sources *Sources, name string, show bool, force boo return updated, nil } -func (source *Source) fetchLatestGitTag(show bool) (string, error) { +func (source *Source) fetchLatestGitTag() (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)) + remotes, err := command("bash", false, "-c", fmt.Sprintf("git ls-remote %s | awk -F'/' '{print $NF}' | sort -V", repository)) if err != nil { return "", err diff --git a/utilities.go b/utilities.go index 7548da4..fc9b339 100644 --- a/utilities.go +++ b/utilities.go @@ -7,14 +7,14 @@ import ( "strings" ) -func fetchSHA256(url string, unpack bool, show bool) (string, error) { +func fetchSHA256(url string, unpack bool) (string, error) { arguments := []string{"--type", "sha256", url} if unpack { arguments = append([]string{"--unpack"}, arguments...) } - output, err := command("nix-prefetch-url", show, arguments...) + output, err := command("nix-prefetch-url", false, arguments...) if err != nil { return "", err diff --git a/yae.go b/yae.go index 525c74b..865e193 100644 --- a/yae.go +++ b/yae.go @@ -88,10 +88,6 @@ func main() { Name: "tag-predicate", Usage: "Git tag predicate used in identifying latest git source", }, - &cli.BoolFlag{ - Name: "silent", - Usage: "Silence output", - }, &cli.StringFlag{ Name: "trim-tag-prefix", Usage: "A prefix to trim from remote git tags", @@ -151,7 +147,7 @@ func main() { source.Force = true } - if sha256, err := fetchSHA256(source.URL, c.Bool("unpack"), !c.Bool("silent")); err != nil { + if sha256, err := fetchSHA256(source.URL, c.Bool("unpack")); err != nil { return err } else { source.SHA256 = sha256 -- cgit v1.2.3