From 0afb186512d77ae8b141eb62b2ed6ceb490aeaa7 Mon Sep 17 00:00:00 2001 From: babarot Date: Tue, 14 Jan 2025 11:18:10 +0900 Subject: [PATCH] Refactor func name --- pkg/config/command.go | 2 +- pkg/config/gist.go | 2 +- pkg/config/github.go | 2 +- pkg/config/http.go | 2 +- pkg/config/util.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/config/command.go b/pkg/config/command.go index 44c5a6e..2d22100 100644 --- a/pkg/config/command.go +++ b/pkg/config/command.go @@ -61,7 +61,6 @@ func (l *Link) UnmarshalYAML(b []byte) error { return nil } -// GetLink is func (c Command) GetLink(pkg Package) ([]Link, error) { var links []Link @@ -92,6 +91,7 @@ func (c Command) GetLink(pkg Package) ([]Link, error) { continue } file := filepath.Join(pkg.GetHome(), link.From) + // zglob can search file path even if file path doesn't includ asterisk at all. matches, err := zglob.Glob(file) if err != nil { return links, errors.Wrapf(err, "%s: failed to get links", pkg.GetName()) diff --git a/pkg/config/gist.go b/pkg/config/gist.go index f851adc..c0a698f 100644 --- a/pkg/config/gist.go +++ b/pkg/config/gist.go @@ -98,7 +98,7 @@ func (c Gist) Installed() bool { list = append(list, err == nil) } - return check(list) + return allTrue(list) } // HasPluginBlock is diff --git a/pkg/config/github.go b/pkg/config/github.go index f22c5d7..fba872b 100644 --- a/pkg/config/github.go +++ b/pkg/config/github.go @@ -225,7 +225,7 @@ func (c GitHub) Installed() bool { list = append(list, err == nil) } - return check(list) + return allTrue(list) } func (c GitHub) GetReleaseTag() string { diff --git a/pkg/config/http.go b/pkg/config/http.go index f6d9d35..4edb9cf 100644 --- a/pkg/config/http.go +++ b/pkg/config/http.go @@ -172,7 +172,7 @@ func (c HTTP) Installed() bool { list = append(list, err == nil) } - return check(list) + return allTrue(list) } // HasPluginBlock is diff --git a/pkg/config/util.go b/pkg/config/util.go index 07a1372..9a93306 100644 --- a/pkg/config/util.go +++ b/pkg/config/util.go @@ -31,7 +31,7 @@ func isExecutable(path string) error { return nil } -func check(list []bool) bool { +func allTrue(list []bool) bool { if len(list) == 0 { return false }