diff --git a/cmd/install.go b/cmd/install.go index 133d3c5..f4a335f 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -193,6 +193,7 @@ func filterSuitableAssets(input []string, filters []string) []string { filtered = exludeExtensions(filtered, ".sha256") filtered = exludeExtensions(filtered, ".sha256sum") filtered = exludeExtensions(filtered, ".md5") + filtered = exludeExtensions(filtered, ".sha") return filtered } diff --git a/cmd/install_test.go b/cmd/install_test.go index e830f47..ce49551 100644 --- a/cmd/install_test.go +++ b/cmd/install_test.go @@ -285,6 +285,28 @@ func TestInstall_filterSuitableAssets_filter_out_md5(t *testing.T) { } } +func TestInstall_filterSuitableAssets_filter_out_sha(t *testing.T) { + input := []string{ + "micro-2.0.14-linux64-static.tar.gz", + "micro-2.0.14-linux64-static.tar.gz.sha", + } + expected := []string{ + "micro-2.0.14-linux64-static.tar.gz", + } + output := filterSuitableAssets(input, []string{}) + + if len(output) != len(expected) { + t.Errorf("Unexpected amount of items in : got %d want %d", len(output), len(expected)) + return + } + + for _, item := range expected { + if !stringInSlice(item, output) { + t.Errorf("Expected %s to be in , got %s", item, output) + } + } +} + func stringInSlice(a string, list []string) bool { for _, b := range list { if b == a {