Plugins: include pre-releases in compatibility lookup (#4506)

Semver doesn't treat pre-release versions as upgrades, meaning >4.3.0 isn't satisfied
by 4.3.1-rc.1.
For the purpose of TL plugins however, we are only interested in the semantic version and
expect that rc's adhere to the compatibility promise.
This commit is contained in:
Reto 2022-04-12 02:47:51 +02:00 committed by GitHub
parent d7bba325a7
commit e4840b4d75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,7 +109,9 @@ function loadPackage(packageName) {
if (
packageInfo.thelounge.supports &&
!semver.satisfies(Helper.getVersionNumber(), packageInfo.thelounge.supports)
!semver.satisfies(Helper.getVersionNumber(), packageInfo.thelounge.supports, {
includePrerelease: true, // our pre-releases should respect the semver guarantees
})
) {
throw `v${packageInfo.version} does not support this version of The Lounge. Supports: ${packageInfo.thelounge.supports}`;
}