Skip to content

Commit d7589d6

Browse files
committedJan 21, 2023
do not process incomplete apps
1 parent 8cb4060 commit d7589d6

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed
 

‎.toolbox.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ tools:
3232
github: kubernetes/minikube
3333
gh:
3434
github: cli/cli
35+
incompleteShouldNotBeConsidered: {}
3536
target: ./download

‎pkg/types/types.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ func (t *Toolbox) GetTools() []*Tool {
1515
var tools []*Tool
1616
for n := range t.Tools {
1717
tool := t.Tools[n]
18-
if tool.Name == "" {
19-
tool.Name = n
18+
19+
if tool.Github != "" || tool.DownloadURL != "" || tool.Google != "" {
20+
if tool.Name == "" {
21+
tool.Name = n
22+
}
23+
tools = append(tools, tool)
2024
}
21-
tools = append(tools, tool)
2225
}
2326

2427
sort.Slice(tools, func(i, j int) bool {

‎pkg/types/types_test.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ var _ = Describe("Types", func() {
1818
Ω(tools).Should(BeEmpty())
1919
})
2020
It("should return an a sorted slice", func() {
21-
t1 := &types.Tool{Name: "xyz"}
22-
t2 := &types.Tool{Name: "abc"}
23-
tb.Tools = map[string]*types.Tool{t1.Name: t1, t2.Name: t2, "foo": {}}
21+
t1 := &types.Tool{Name: "xyz", Github: "foo"}
22+
t2 := &types.Tool{Name: "abc", Google: "bar"}
23+
t3 := &types.Tool{Name: "no-source"}
24+
tb.Tools = map[string]*types.Tool{t1.Name: t1, t2.Name: t2, t3.Name: t3, "foo": {DownloadURL: "url"}}
2425
tools := tb.GetTools()
2526
Ω(tools).Should(HaveLen(3))
2627
Ω(tools[0].Name).Should(Equal("abc"))
@@ -34,9 +35,9 @@ var _ = Describe("Types", func() {
3435
Ω(versions.Versions).Should(BeEmpty())
3536
})
3637
It("should return an a sorted slice", func() {
37-
t1 := &types.Tool{Name: "xyz", CouldNotBeFound: true}
38-
t2 := &types.Tool{Name: "abc", Version: "v1.0.0"}
39-
tb.Tools = map[string]*types.Tool{t1.Name: t1, t2.Name: t2, "foo": {Version: "v1.2.3"}}
38+
t1 := &types.Tool{Name: "xyz", CouldNotBeFound: true, Github: "foo"}
39+
t2 := &types.Tool{Name: "abc", Version: "v1.0.0", Github: "foo"}
40+
tb.Tools = map[string]*types.Tool{t1.Name: t1, t2.Name: t2, "foo": {Version: "v1.2.3", Github: "foo"}}
4041
versions := tb.Versions()
4142
Ω(versions.Versions).Should(HaveLen(2))
4243
Ω(versions.Versions).Should(HaveKey("abc"))

0 commit comments

Comments
 (0)
Please sign in to comment.