@@ -79,7 +79,7 @@ _getPackageVersion() {
7979checkLinks () {
8080 bool foundError = false ;
8181 Set <String > visited = new Set ();
82- final origin = 'testing/test_package/doc/api /' ;
82+ final origin = 'testing/test_package_docs /' ;
8383 var start = 'index.html' ;
8484
8585 _doCheck (origin, visited, start, foundError);
@@ -267,8 +267,11 @@ _doCheck(String origin, Set<String> visited, String pathToCheck, bool error,
267267
268268 File file = new File ("$fullPath " );
269269 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+ }
272275 return ;
273276 }
274277 Document doc = parse (file.readAsStringSync ());
@@ -283,7 +286,12 @@ _doCheck(String origin, Set<String> visited, String pathToCheck, bool error,
283286 .where ((href) => href != null )
284287 .forEach ((href) {
285288 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+ }
287295 var normalized = path.normalize (full);
288296 _doCheck (origin, visited, normalized, error, pathToCheck);
289297 }
0 commit comments