aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-12 06:50:10 -0700
committerFuwn <[email protected]>2024-10-12 06:50:10 -0700
commit40f9bc9d441c78214540240413ad74807c28e30b (patch)
tree13083665a78862d7001e62ec42b9018727088147
parent32757ce6d8be9a352c3fcf6b4893edf42e8018bd (diff)
downloadyae-40f9bc9d441c78214540240413ad74807c28e30b.tar.xz
yae-40f9bc9d441c78214540240413ad74807c28e30b.zip
feat(yae): hide internal tool logs
-rw-r--r--source.go8
-rw-r--r--utilities.go4
-rw-r--r--yae.go6
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