(spotifyBinaryPath string)
| 1072 | } |
| 1073 | |
| 1074 | func validateReleaseBuild(spotifyBinaryPath string) error { |
| 1075 | fileContent, err := os.ReadFile(spotifyBinaryPath) |
| 1076 | if err != nil { |
| 1077 | return fmt.Errorf("could not read %s: %w", filepath.Base(spotifyBinaryPath), err) |
| 1078 | } |
| 1079 | |
| 1080 | buildRegex := regexp.MustCompile(`(Master|Release|PR|Local) Build.+(?:cef_)?(\d+\.\d+\.\d+\+g[0-9a-f]+\+chromium-\d+\.\d+\.\d+\.\d+)`) |
| 1081 | matches := buildRegex.FindSubmatch(fileContent) |
| 1082 | |
| 1083 | if len(matches) == 0 { |
| 1084 | utils.PrintWarning(fmt.Sprintf("Could not detect Spotify build type in %s, skipping validation", filepath.Base(spotifyBinaryPath))) |
| 1085 | return nil |
| 1086 | } |
| 1087 | |
| 1088 | buildType := string(matches[1]) |
| 1089 | if buildType != "Release" { |
| 1090 | return fmt.Errorf("detected %s Spotify build! spicetify works only on Release builds. Please install latest Release version of Spotify", buildType) |
| 1091 | } |
| 1092 | |
| 1093 | utils.PrintSuccess(fmt.Sprintf("Spotify's build type is %s. Continuing...", string(matches[1]))) |
| 1094 | return nil |
| 1095 | } |
| 1096 | |
| 1097 | type githubRelease = utils.GithubRelease |
| 1098 |
no test coverage detected