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

used for versions like 2.1.0-DEBUG
pull/23161/head
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
1 changed files with 1 additions and 1 deletions

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]));
}