Skip to content

Commit f137745

Browse files
committed
ignore sum files and prefer binaries
1 parent 2365f2e commit f137745

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.toolbox.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ tools:
2626
jf:
2727
github: jfrog/jfrog-cli
2828
downloadURL: https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/{{ .VersionNum }}/jfrog-cli-{{ .OS }}-{{ .Arch }}/jf{{ .FileExt }}
29+
kind:
30+
github: kubernetes-sigs/kind
31+
minikube:
32+
github: kubernetes/minikube
2933
target: ./download

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func findMatching(toolName string, assets []types.Asset) *types.Asset {
194194
var matching []*types.Asset
195195
for i := range assets {
196196
a := assets[i]
197-
if strings.Contains(a.Name, toolName) && matches(runtime.GOOS, a.Name) {
197+
if strings.Contains(a.Name, toolName) && matches(runtime.GOOS, a.Name) && !strings.HasSuffix(a.Name, "sum") {
198198
matching = append(matching, &a)
199199
}
200200
}
@@ -206,6 +206,11 @@ func findMatching(toolName string, assets []types.Asset) *types.Asset {
206206
mi = strings.Contains(matching[i].Name, runtime.GOARCH)
207207
mj = strings.Contains(matching[j].Name, runtime.GOARCH)
208208
}
209+
if mi == mj {
210+
// prefer non archive files
211+
mi = !strings.Contains(matching[i].Name, ".")
212+
mj = !strings.Contains(matching[j].Name, ".")
213+
}
209214
if mi == mj {
210215
return true
211216
}

0 commit comments

Comments
 (0)