fix: semver parser grab everything before hyphen (#23140)

used for versions like 2.1.0-DEBUG
This commit is contained in:
Brandon Wees 2025-10-22 10:06:40 -05:00 committed by GitHub
parent a70843e2b4
commit efac8c6667
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,7 @@ class SemVer {
}
factory SemVer.fromString(String version) {
final parts = version.split('.');
final parts = version.split("-")[0].split('.');
return SemVer(major: int.parse(parts[0]), minor: int.parse(parts[1]), patch: int.parse(parts[2]));
}