mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
gracefully handle generating docs twice (#3939)
* gracefully handle generating docs twice * silently handle if directory doesn't exist
This commit is contained in:
parent
3252701753
commit
a03c8f77ad
@ -89,6 +89,7 @@ dependencies:
|
|||||||
/// paths. Cleanup unused index.html files no longer needed.
|
/// paths. Cleanup unused index.html files no longer needed.
|
||||||
void createIndexAndCleanup() {
|
void createIndexAndCleanup() {
|
||||||
print('\nCreating a custom index.html in $kDocRoot/index.html');
|
print('\nCreating a custom index.html in $kDocRoot/index.html');
|
||||||
|
removeOldFlutterDocsDir();
|
||||||
renameApiDir();
|
renameApiDir();
|
||||||
copyIndexToRootOfDocs();
|
copyIndexToRootOfDocs();
|
||||||
addHtmlBaseToIndex();
|
addHtmlBaseToIndex();
|
||||||
@ -96,6 +97,14 @@ void createIndexAndCleanup() {
|
|||||||
print('\nDocs ready to go!');
|
print('\nDocs ready to go!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void removeOldFlutterDocsDir() {
|
||||||
|
try {
|
||||||
|
new Directory('$kDocRoot/flutter').deleteSync(recursive: true);
|
||||||
|
} catch(e) {
|
||||||
|
// If the directory does not exist, that's OK.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void renameApiDir() {
|
void renameApiDir() {
|
||||||
new Directory('$kDocRoot/api').renameSync('$kDocRoot/flutter');
|
new Directory('$kDocRoot/api').renameSync('$kDocRoot/flutter');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user