File tree 4 files changed +18
-9
lines changed
4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.5.0+1
2
+ * [ bug] fixed an issue running dartdoc as a pub global activated snapshot
3
+
1
4
## 0.5.0
2
5
* [ health] remove calls to deprecated methods
3
6
* [ health] remove workaround when sorting empty iterable
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export 'src/package_meta.dart';
36
36
37
37
const String name = 'dartdoc' ;
38
38
// Update when pubspec version changes.
39
- const String version = '0.5.0' ;
39
+ const String version = '0.5.0+1 ' ;
40
40
41
41
final String defaultOutDir = 'doc${Platform .pathSeparator }api' ;
42
42
Original file line number Diff line number Diff line change @@ -26,11 +26,15 @@ Future<String> loadAsString(String path) {
26
26
if (! path.startsWith ('package:' )) {
27
27
throw new ArgumentError ('path must begin with package:' );
28
28
}
29
- return new Resource (path).readAsString ().catchError ((_) async {
30
- // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
31
- var bytes = await _doLoad (path);
32
- return new String .fromCharCodes (bytes);
33
- });
29
+
30
+ try {
31
+ return new Resource (path).readAsString ().catchError ((_) {
32
+ // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
33
+ return _doLoad (path).then ((bytes) => new String .fromCharCodes (bytes));
34
+ });
35
+ } catch (_) {
36
+ return _doLoad (path).then ((bytes) => new String .fromCharCodes (bytes));
37
+ }
34
38
}
35
39
36
40
/// Loads a `package:` resource as an [List<int>] .
@@ -39,10 +43,12 @@ Future<List<int>> loadAsBytes(String path) {
39
43
throw new ArgumentError ('path must begin with package:' );
40
44
}
41
45
42
- return new Resource (path). readAsBytes (). catchError ((_) {
46
+ try {
43
47
// TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
48
+ return new Resource (path).readAsBytes ().catchError ((_) => _doLoad (path));
49
+ } catch (_) {
44
50
return _doLoad (path);
45
- });
51
+ }
46
52
}
47
53
48
54
/// Determine how to do the load. HTTP? Snapshotted? From source?
Original file line number Diff line number Diff line change 1
1
name : dartdoc
2
2
# Also update the `version` field in lib/dartdoc.dart.
3
- version : 0.5.0
3
+ version : 0.5.0+1
4
4
author :
Dart Team <[email protected] >
5
5
description : A documentation generator for Dart.
6
6
homepage : https://github.com/dart-lang/dartdoc
You can’t perform that action at this time.
0 commit comments