Skip to content

Commit 07742be

Browse files
committed
Remove extra version info
Follow up to #2538 This is only relevant when using the test runner as a git or path dependency. In these cases the version will already end in `-WIP` with out current development practices and in the places where it may come up the users don't need help understanding where the code is coming from.
1 parent 3e80550 commit 07742be

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

pkgs/test_core/lib/src/runner/version.dart

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -58,36 +58,8 @@ String? _readPubspecLock() {
5858
if (packages is! Map) return null;
5959
var package = packages['test'];
6060
if (package is! Map) return null;
61-
6261
var source = package['source'];
6362
if (source is! String) return null;
64-
65-
switch (source) {
66-
case 'hosted':
67-
var version = package['version'];
68-
return (version is String) ? version : null;
69-
70-
case 'git':
71-
var version = package['version'];
72-
if (version is! String) return null;
73-
var description = package['description'];
74-
if (description is! Map) return null;
75-
var ref = description['resolved-ref'];
76-
if (ref is! String) return null;
77-
78-
return '$version (${ref.substring(0, 7)})';
79-
80-
case 'path':
81-
var version = package['version'];
82-
if (version is! String) return null;
83-
var description = package['description'];
84-
if (description is! Map) return null;
85-
var path = description['path'];
86-
if (path is! String) return null;
87-
88-
return '$version (from $path)';
89-
90-
default:
91-
return null;
92-
}
63+
var version = package['version'];
64+
return (version is String) ? version : null;
9365
}

0 commit comments

Comments
 (0)