@@ -79,7 +79,7 @@ _getPackageVersion() {
79
79
checkLinks () {
80
80
bool foundError = false ;
81
81
Set <String > visited = new Set ();
82
- final origin = 'testing/test_package/doc/api /' ;
82
+ final origin = 'testing/test_package_docs /' ;
83
83
var start = 'index.html' ;
84
84
85
85
_doCheck (origin, visited, start, foundError);
@@ -267,8 +267,11 @@ _doCheck(String origin, Set<String> visited, String pathToCheck, bool error,
267
267
268
268
File file = new File ("$fullPath " );
269
269
if (! file.existsSync ()) {
270
- error = true ;
271
- log (' * Not found: $fullPath from $source ' );
270
+ // There is a deliberately broken link in one place.
271
+ if (! fullPath.endsWith ("ftp:/ftp.myfakepackage.com/donthidemyschema" )) {
272
+ error = true ;
273
+ log (' * Not found: $fullPath from $source ' );
274
+ }
272
275
return ;
273
276
}
274
277
Document doc = parse (file.readAsStringSync ());
@@ -283,7 +286,12 @@ _doCheck(String origin, Set<String> visited, String pathToCheck, bool error,
283
286
.where ((href) => href != null )
284
287
.forEach ((href) {
285
288
if (! href.startsWith ('http' ) && ! href.contains ('#' )) {
286
- var full = '${path .dirname (pathToCheck )}/$baseHref /$href ' ;
289
+ var full;
290
+ if (baseHref != null ) {
291
+ full = '${path .dirname (pathToCheck )}/$baseHref /$href ' ;
292
+ } else {
293
+ full = '${path .dirname (pathToCheck )}/$href ' ;
294
+ }
287
295
var normalized = path.normalize (full);
288
296
_doCheck (origin, visited, normalized, error, pathToCheck);
289
297
}
0 commit comments