1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

Fix cookbook scraper bugs and re-run (#697)

* fix path separator bug in cookbook scraper

* update lockfiles

* add category to image name to avoid conflicts

e.g.
testing/integration/introduction
testing/widget/introduction

* fix form_app symlink

* remove webimages directory

* remove vision_challenge

vision_challenge doesn't build on the dev channel

* update pubspec.yaml in _tool and form_app
This commit is contained in:
John Ryan
2021-02-08 10:36:22 -08:00
committed by GitHub
parent 20f8b71f28
commit 241e2c1b26
143 changed files with 266 additions and 638 deletions

View File

@@ -55,7 +55,7 @@ class CookbookScraper {
Future takeScreenshot(String url) async {
var screenshot = await _driver.captureScreenshotAsList();
var file = File('web${screenshotPath(url)}');
var file = File('web/${screenshotPath(url)}');
await file.create(recursive: true);
await file.writeAsBytes(screenshot);
}
@@ -72,5 +72,9 @@ String screenshotPath(String url) {
String parseFileName(String link) {
var p = path.basename(link);
var dot = p.indexOf('.');
return p.substring(0, dot);
var detailName = p.substring(0, dot);
// var categoryName = path.split(link);
var components = path.split(link);
var categoryName = components[components.length - 2];
return '$categoryName-$detailName';
}