Skip to content

Commit

Permalink
feat: do not print blacklisted versions
Browse files Browse the repository at this point in the history
  • Loading branch information
juev committed Sep 11, 2023
1 parent 6d9a33b commit 2505d29
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion gobrew.go
Expand Up @@ -207,7 +207,9 @@ func (gb *GoBrew) getGroupedVersion(versions []string, print bool) map[string][]
if len(matches) == 1 {
majorVersion = strings.Split(version, matches[0])[0]
}
groupedVersions[majorVersion] = append(groupedVersions[majorVersion], version)
if !isBlackListed(majorVersion) {
groupedVersions[majorVersion] = append(groupedVersions[majorVersion], version)
}
}
}

Expand Down Expand Up @@ -293,6 +295,16 @@ func (gb *GoBrew) getGroupedVersion(versions []string, print bool) map[string][]
return groupedVersions
}

func isBlackListed(version string) bool {
blackListVersions := []string{"1.0", "1.1", "1.2", "1.3", "1.4"}
for _, v := range blackListVersions {
if version == v {
return true
}
}
return false
}

func (gb *GoBrew) print(message string, shouldPrint bool) {
if shouldPrint {
color.Infop(message)
Expand Down

0 comments on commit 2505d29

Please sign in to comment.