MCPcopy
hub / github.com/spicetify/cli / splitVersion

Function splitVersion

src/preprocess/preprocess.go:1099–1117  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

1097type githubRelease = utils.GithubRelease
1098
1099func splitVersion(version string) ([3]int, error) {
1100 vstring := version
1101 if vstring[0:1] == "v" {
1102 vstring = version[1:]
1103 }
1104 vSplit := strings.Split(vstring, ".")
1105 var vInts [3]int
1106 if len(vSplit) != 3 {
1107 return [3]int{}, errors.New("invalid version string")
1108 }
1109 for i := range 3 {
1110 conv, err := strconv.Atoi(vSplit[i])
1111 if err != nil {
1112 return [3]int{}, err
1113 }
1114 vInts[i] = conv
1115 }
1116 return vInts, nil
1117}
1118
1119func FetchLatestTagMatchingOrMain(version string) (string, error) {
1120 tag, err := utils.FetchLatestTag()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected