File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -226,9 +226,20 @@ class Package extends LibraryContainer
226
226
case 'b' :
227
227
{
228
228
Version version = Version .parse (packageMeta.version);
229
- return version.isPreRelease
230
- ? version.preRelease.first
231
- : 'stable' ;
229
+ String tag = 'stable' ;
230
+ if (version.isPreRelease) {
231
+ // version.preRelease is a List<dynamic> with a mix of
232
+ // integers and strings. Given this, handle
233
+ // 2.8.0-dev.1.0, 2.9.0-1.0.dev, and similar
234
+ // variations.
235
+ tag = version.preRelease.whereType <String >().first;
236
+ // Who knows about non-SDK packages, but assert that SDKs
237
+ // must conform to the known format.
238
+ assert (
239
+ packageMeta.isSdk == false || int .tryParse (tag) == null ,
240
+ 'Got an integer as string instead of the expected "dev" tag' );
241
+ }
242
+ return tag;
232
243
}
233
244
case 'n' :
234
245
return name;
You can’t perform that action at this time.
0 commit comments