Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2643)

Unified Diff: scripts/convert_book.dart

Issue 24596006: Fix the book build script, and regenerate the book (add to*Case note) (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/pubspec.lock » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/convert_book.dart
diff --git a/scripts/convert_book.dart b/scripts/convert_book.dart
index 642ee505cba0c789087082c7eb2e9064886d6232..e08dbd0b60039c1381387f2b4af1be7d291ac970 100755
--- a/scripts/convert_book.dart
+++ b/scripts/convert_book.dart
@@ -1,7 +1,7 @@
#!/usr/bin/env dart
import 'dart:io';
-import 'dart:async';
+import 'package:path/path.dart' as path;
Directory outputDir;
@@ -26,7 +26,7 @@ convertFile(String fileName) {
var start = contents.indexOf(r'<div class="navheader">');
var end = contents.lastIndexOf(r'</body></html>');
var body = contents.substring(start, end);
- var filenameOnly = new Path(fileName).filename;
+ var filenameOnly = path.basename(fileName);
writeFile(filenameOnly, title, body);
}
@@ -34,7 +34,7 @@ convertFile(String fileName) {
writeFile(String fileName, String title, String body) {
var out = new File('${outputDir.path}/${fileName}');
out.writeAsStringSync(frontMatter(title));
- out.writeAsStringSync(body, mode: FileMode.APPEND, encoding: Encoding.UTF_8);
+ out.writeAsStringSync(body, mode: FileMode.APPEND);
}
checkDir(Directory dir) {
@@ -61,4 +61,4 @@ main() {
.map((f) => f.path)
.where((name) => name.endsWith(".html"))
.forEach((name) => convertFile(name));
-}
+}
« no previous file with comments | « no previous file | scripts/pubspec.lock » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698