Clean up usage of temporary directories (#20682)
All temporary directory start with `flutter_` and have their random component separated from the name by a period, as in `flutter_test_bundle.YFYQMY`. I've tried to find some of the places where we didn't cleanly delete temporary directories, too. This greatly reduces, though it does not entirely eliminate, the directories we leave behind when running tests, especially `flutter_tools` tests. While I was at it I standardized on `tempDir` as the variable name for temporary directories, since it was the most common, removing occurrences of `temp` and `tmp`, among others. Also I factored out some common code that used to catch exceptions that happen on Windows, and made more places use that pattern.
This commit is contained in:
@@ -100,13 +100,13 @@ const String kDartDocPrefix = '///';
|
||||
const String kDartDocPrefixWithSpace = '$kDartDocPrefix ';
|
||||
|
||||
Future<Null> main() async {
|
||||
final Directory temp = Directory.systemTemp.createTempSync('analyze_sample_code_');
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_analyze_sample_code.');
|
||||
int exitCode = 1;
|
||||
bool keepMain = false;
|
||||
final List<String> buffer = <String>[];
|
||||
try {
|
||||
final File mainDart = new File(path.join(temp.path, 'main.dart'));
|
||||
final File pubSpec = new File(path.join(temp.path, 'pubspec.yaml'));
|
||||
final File mainDart = new File(path.join(tempDir.path, 'main.dart'));
|
||||
final File pubSpec = new File(path.join(tempDir.path, 'pubspec.yaml'));
|
||||
final Directory flutterPackage = new Directory(path.join(_flutterRoot, 'packages', 'flutter', 'lib'));
|
||||
final List<Section> sections = <Section>[];
|
||||
int sampleCodeSections = 0;
|
||||
@@ -210,7 +210,7 @@ dependencies:
|
||||
final Process process = await Process.start(
|
||||
_flutter,
|
||||
<String>['analyze', '--no-preamble', '--no-congratulate', mainDart.parent.path],
|
||||
workingDirectory: temp.path,
|
||||
workingDirectory: tempDir.path,
|
||||
);
|
||||
stderr.addStream(process.stderr);
|
||||
final List<String> errors = await process.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).toList();
|
||||
@@ -285,7 +285,7 @@ dependencies:
|
||||
print('No errors!');
|
||||
} finally {
|
||||
if (keepMain) {
|
||||
print('Kept ${temp.path} because it had errors (see above).');
|
||||
print('Kept ${tempDir.path} because it had errors (see above).');
|
||||
print('-------8<-------');
|
||||
int number = 1;
|
||||
for (String line in buffer) {
|
||||
@@ -295,10 +295,9 @@ dependencies:
|
||||
print('-------8<-------');
|
||||
} else {
|
||||
try {
|
||||
temp.deleteSync(recursive: true);
|
||||
tempDir.deleteSync(recursive: true);
|
||||
} on FileSystemException catch (e) {
|
||||
// ignore errors deleting the temporary directory
|
||||
print('Ignored exception during tearDown: $e');
|
||||
print('Failed to delete ${tempDir.path}: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -640,7 +640,7 @@ Future<Null> main(List<String> argList) async {
|
||||
Directory tempDir;
|
||||
bool removeTempDir = false;
|
||||
if (args['temp_dir'] == null || args['temp_dir'].isEmpty) {
|
||||
tempDir = Directory.systemTemp.createTempSync('flutter_');
|
||||
tempDir = Directory.systemTemp.createTempSync('flutter_package.');
|
||||
removeTempDir = true;
|
||||
} else {
|
||||
tempDir = new Directory(args['temp_dir']);
|
||||
|
||||
@@ -191,7 +191,7 @@ Future<Null> _analyzeRepo() async {
|
||||
await _checkForTrailingSpaces();
|
||||
|
||||
// Try analysis against a big version of the gallery; generate into a temporary directory.
|
||||
final String outDir = Directory.systemTemp.createTempSync('mega_gallery').path;
|
||||
final Directory outDir = Directory.systemTemp.createTempSync('flutter_mega_gallery.');
|
||||
|
||||
try {
|
||||
await _runCommand(dart,
|
||||
@@ -199,17 +199,13 @@ Future<Null> _analyzeRepo() async {
|
||||
'--preview-dart-2',
|
||||
path.join(flutterRoot, 'dev', 'tools', 'mega_gallery.dart'),
|
||||
'--out',
|
||||
outDir,
|
||||
outDir.path,
|
||||
],
|
||||
workingDirectory: flutterRoot,
|
||||
);
|
||||
await _runFlutterAnalyze(outDir, options: <String>['--watch', '--benchmark']);
|
||||
await _runFlutterAnalyze(outDir.path, options: <String>['--watch', '--benchmark']);
|
||||
} finally {
|
||||
try {
|
||||
new Directory(outDir).deleteSync(recursive: true);
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
outDir.deleteSync(recursive: true);
|
||||
}
|
||||
|
||||
print('${bold}DONE: Analysis successful.$reset');
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
||||
import 'package:test/test.dart' as test_package show TypeMatcher;
|
||||
|
||||
@@ -12,3 +14,14 @@ export 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
||||
|
||||
/// A matcher that compares the type of the actual value to the type argument T.
|
||||
Matcher isInstanceOf<T>() => new test_package.TypeMatcher<T>(); // ignore: prefer_const_constructors, https://github.com/dart-lang/sdk/issues/32544
|
||||
|
||||
void tryToDelete(Directory directory) {
|
||||
// This should not be necessary, but it turns out that
|
||||
// on Windows it's common for deletions to fail due to
|
||||
// bogus (we think) "access denied" errors.
|
||||
try {
|
||||
directory.deleteSync(recursive: true);
|
||||
} on FileSystemException catch (error) {
|
||||
print('Failed to delete ${directory.path}: $error');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void main() {
|
||||
});
|
||||
group('ArchiveCreator for $platformName', () {
|
||||
ArchiveCreator creator;
|
||||
Directory tmpDir;
|
||||
Directory tempDir;
|
||||
Directory flutterDir;
|
||||
FakeProcessManager processManager;
|
||||
final List<List<String>> args = <List<String>>[];
|
||||
@@ -82,12 +82,12 @@ void main() {
|
||||
processManager = new FakeProcessManager();
|
||||
args.clear();
|
||||
namedArgs.clear();
|
||||
tmpDir = await Directory.systemTemp.createTemp('flutter_');
|
||||
flutterDir = new Directory(path.join(tmpDir.path, 'flutter'));
|
||||
tempDir = Directory.systemTemp.createTempSync('flutter_prepage_package_test.');
|
||||
flutterDir = new Directory(path.join(tempDir.path, 'flutter'));
|
||||
flutterDir.createSync(recursive: true);
|
||||
creator = new ArchiveCreator(
|
||||
tmpDir,
|
||||
tmpDir,
|
||||
tempDir,
|
||||
tempDir,
|
||||
testRef,
|
||||
Branch.dev,
|
||||
processManager: processManager,
|
||||
@@ -99,16 +99,11 @@ void main() {
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
// On Windows, the directory is locked and not able to be deleted yet. So
|
||||
// we just leave some (very small, because we're not actually building
|
||||
// archives here) trash around to be deleted at the next reboot.
|
||||
if (!platform.isWindows) {
|
||||
await tmpDir.delete(recursive: true);
|
||||
}
|
||||
tryToDelete(tempDir);
|
||||
});
|
||||
|
||||
test('sets PUB_CACHE properly', () async {
|
||||
final String createBase = path.join(tmpDir.absolute.path, 'create_');
|
||||
final String createBase = path.join(tempDir.absolute.path, 'create_');
|
||||
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
||||
'git clone -b dev https://chromium.googlesource.com/external/github.com/flutter/flutter': null,
|
||||
'git reset --hard $testRef': null,
|
||||
@@ -116,7 +111,7 @@ void main() {
|
||||
'git describe --tags --abbrev=0': <ProcessResult>[new ProcessResult(0, 0, 'v1.2.3', '')],
|
||||
};
|
||||
if (platform.isWindows) {
|
||||
calls['7za x ${path.join(tmpDir.path, 'mingit.zip')}'] = null;
|
||||
calls['7za x ${path.join(tempDir.path, 'mingit.zip')}'] = null;
|
||||
}
|
||||
calls.addAll(<String, List<ProcessResult>>{
|
||||
'$flutter doctor': null,
|
||||
@@ -128,7 +123,7 @@ void main() {
|
||||
'$flutter create --template=plugin ${createBase}plugin': null,
|
||||
'git clean -f -X **/.packages': null,
|
||||
});
|
||||
final String archiveName = path.join(tmpDir.absolute.path,
|
||||
final String archiveName = path.join(tempDir.absolute.path,
|
||||
'flutter_${platformName}_v1.2.3-dev${platform.isLinux ? '.tar.xz' : '.zip'}');
|
||||
if (platform.isWindows) {
|
||||
calls['7za a -tzip -mx=9 $archiveName flutter'] = null;
|
||||
@@ -151,7 +146,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('calls the right commands for archive output', () async {
|
||||
final String createBase = path.join(tmpDir.absolute.path, 'create_');
|
||||
final String createBase = path.join(tempDir.absolute.path, 'create_');
|
||||
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
||||
'git clone -b dev https://chromium.googlesource.com/external/github.com/flutter/flutter': null,
|
||||
'git reset --hard $testRef': null,
|
||||
@@ -159,7 +154,7 @@ void main() {
|
||||
'git describe --tags --abbrev=0': <ProcessResult>[new ProcessResult(0, 0, 'v1.2.3', '')],
|
||||
};
|
||||
if (platform.isWindows) {
|
||||
calls['7za x ${path.join(tmpDir.path, 'mingit.zip')}'] = null;
|
||||
calls['7za x ${path.join(tempDir.path, 'mingit.zip')}'] = null;
|
||||
}
|
||||
calls.addAll(<String, List<ProcessResult>>{
|
||||
'$flutter doctor': null,
|
||||
@@ -171,7 +166,7 @@ void main() {
|
||||
'$flutter create --template=plugin ${createBase}plugin': null,
|
||||
'git clean -f -X **/.packages': null,
|
||||
});
|
||||
final String archiveName = path.join(tmpDir.absolute.path,
|
||||
final String archiveName = path.join(tempDir.absolute.path,
|
||||
'flutter_${platformName}_v1.2.3-dev${platform.isLinux ? '.tar.xz' : '.zip'}');
|
||||
if (platform.isWindows) {
|
||||
calls['7za a -tzip -mx=9 $archiveName flutter'] = null;
|
||||
@@ -182,8 +177,8 @@ void main() {
|
||||
}
|
||||
processManager.fakeResults = calls;
|
||||
creator = new ArchiveCreator(
|
||||
tmpDir,
|
||||
tmpDir,
|
||||
tempDir,
|
||||
tempDir,
|
||||
testRef,
|
||||
Branch.dev,
|
||||
processManager: processManager,
|
||||
@@ -214,17 +209,11 @@ void main() {
|
||||
|
||||
setUp(() async {
|
||||
processManager = new FakeProcessManager();
|
||||
tempDir = await Directory.systemTemp.createTemp('flutter_');
|
||||
tempDir.createSync();
|
||||
tempDir = Directory.systemTemp.createTempSync('flutter_prepage_package_test.');
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
// On Windows, the directory is locked and not able to be deleted yet. So
|
||||
// we just leave some (very small, because we're not actually building
|
||||
// archives here) trash around to be deleted at the next reboot.
|
||||
if (!platform.isWindows) {
|
||||
await tempDir.delete(recursive: true);
|
||||
}
|
||||
tryToDelete(tempDir);
|
||||
});
|
||||
|
||||
test('calls the right processes', () async {
|
||||
|
||||
@@ -14,25 +14,25 @@ String errorMessage;
|
||||
|
||||
/// Runs the given [testFunction] on a freshly generated Flutter project.
|
||||
Future<void> runProjectTest(Future<void> testFunction(FlutterProject project)) async {
|
||||
final Directory tmp = await Directory.systemTemp.createTemp('gradle');
|
||||
final FlutterProject project = await FlutterProject.create(tmp, 'hello');
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_gradle_plugin_test.');
|
||||
final FlutterProject project = await FlutterProject.create(tempDir, 'hello');
|
||||
|
||||
try {
|
||||
await testFunction(project);
|
||||
} finally {
|
||||
project.parent.deleteSync(recursive: true);
|
||||
rmTree(tempDir);
|
||||
}
|
||||
}
|
||||
|
||||
/// Runs the given [testFunction] on a freshly generated Flutter plugin project.
|
||||
Future<void> runPluginProjectTest(Future<void> testFunction(FlutterPluginProject pluginProject)) async {
|
||||
final Directory tmp = await Directory.systemTemp.createTemp('gradle');
|
||||
final FlutterPluginProject pluginProject = await FlutterPluginProject.create(tmp, 'aaa');
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_gradle_plugin_test.');
|
||||
final FlutterPluginProject pluginProject = await FlutterPluginProject.create(tempDir, 'aaa');
|
||||
|
||||
try {
|
||||
await testFunction(pluginProject);
|
||||
} finally {
|
||||
pluginProject.parent.deleteSync(recursive: true);
|
||||
rmTree(tempDir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
@@ -22,9 +23,9 @@ Future<Null> main() async {
|
||||
|
||||
section('Create Flutter module project');
|
||||
|
||||
final Directory directory = await Directory.systemTemp.createTemp('module');
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_module_test.');
|
||||
try {
|
||||
await inDirectory(directory, () async {
|
||||
await inDirectory(tempDir, () async {
|
||||
await flutter(
|
||||
'create',
|
||||
options: <String>['--org', 'io.flutter.devicelab', '-t', 'module', 'hello'],
|
||||
@@ -33,14 +34,14 @@ Future<Null> main() async {
|
||||
|
||||
section('Add plugins');
|
||||
|
||||
final File pubspec = new File(path.join(directory.path, 'hello', 'pubspec.yaml'));
|
||||
final File pubspec = new File(path.join(tempDir.path, 'hello', 'pubspec.yaml'));
|
||||
String content = await pubspec.readAsString();
|
||||
content = content.replaceFirst(
|
||||
'\ndependencies:\n',
|
||||
'\ndependencies:\n battery:\n package_info:\n',
|
||||
);
|
||||
await pubspec.writeAsString(content, flush: true);
|
||||
await inDirectory(new Directory(path.join(directory.path, 'hello')), () async {
|
||||
await inDirectory(new Directory(path.join(tempDir.path, 'hello')), () async {
|
||||
await flutter(
|
||||
'packages',
|
||||
options: <String>['get'],
|
||||
@@ -49,7 +50,7 @@ Future<Null> main() async {
|
||||
|
||||
section('Build Flutter module library archive');
|
||||
|
||||
await inDirectory(new Directory(path.join(directory.path, 'hello', '.android')), () async {
|
||||
await inDirectory(new Directory(path.join(tempDir.path, 'hello', '.android')), () async {
|
||||
await exec(
|
||||
'./gradlew',
|
||||
<String>['flutter:assembleDebug'],
|
||||
@@ -58,7 +59,7 @@ Future<Null> main() async {
|
||||
});
|
||||
|
||||
final bool aarBuilt = exists(new File(path.join(
|
||||
directory.path,
|
||||
tempDir.path,
|
||||
'hello',
|
||||
'.android',
|
||||
'Flutter',
|
||||
@@ -74,7 +75,7 @@ Future<Null> main() async {
|
||||
|
||||
section('Build ephemeral host app');
|
||||
|
||||
await inDirectory(new Directory(path.join(directory.path, 'hello')), () async {
|
||||
await inDirectory(new Directory(path.join(tempDir.path, 'hello')), () async {
|
||||
await flutter(
|
||||
'build',
|
||||
options: <String>['apk'],
|
||||
@@ -82,7 +83,7 @@ Future<Null> main() async {
|
||||
});
|
||||
|
||||
final bool ephemeralHostApkBuilt = exists(new File(path.join(
|
||||
directory.path,
|
||||
tempDir.path,
|
||||
'hello',
|
||||
'build',
|
||||
'host',
|
||||
@@ -98,13 +99,13 @@ Future<Null> main() async {
|
||||
|
||||
section('Clean build');
|
||||
|
||||
await inDirectory(new Directory(path.join(directory.path, 'hello')), () async {
|
||||
await inDirectory(new Directory(path.join(tempDir.path, 'hello')), () async {
|
||||
await flutter('clean');
|
||||
});
|
||||
|
||||
section('Materialize host app');
|
||||
|
||||
await inDirectory(new Directory(path.join(directory.path, 'hello')), () async {
|
||||
await inDirectory(new Directory(path.join(tempDir.path, 'hello')), () async {
|
||||
await flutter(
|
||||
'materialize',
|
||||
options: <String>['android'],
|
||||
@@ -113,7 +114,7 @@ Future<Null> main() async {
|
||||
|
||||
section('Build materialized host app');
|
||||
|
||||
await inDirectory(new Directory(path.join(directory.path, 'hello')), () async {
|
||||
await inDirectory(new Directory(path.join(tempDir.path, 'hello')), () async {
|
||||
await flutter(
|
||||
'build',
|
||||
options: <String>['apk'],
|
||||
@@ -121,7 +122,7 @@ Future<Null> main() async {
|
||||
});
|
||||
|
||||
final bool materializedHostApkBuilt = exists(new File(path.join(
|
||||
directory.path,
|
||||
tempDir.path,
|
||||
'hello',
|
||||
'build',
|
||||
'host',
|
||||
@@ -137,18 +138,18 @@ Future<Null> main() async {
|
||||
|
||||
section('Add to Android app');
|
||||
|
||||
final Directory hostApp = new Directory(path.join(directory.path, 'hello_host_app'));
|
||||
final Directory hostApp = new Directory(path.join(tempDir.path, 'hello_host_app'));
|
||||
mkdir(hostApp);
|
||||
recursiveCopy(
|
||||
new Directory(path.join(flutterDirectory.path, 'dev', 'integration_tests', 'android_host_app')),
|
||||
hostApp,
|
||||
);
|
||||
copy(
|
||||
new File(path.join(directory.path, 'hello', '.android', 'gradlew')),
|
||||
new File(path.join(tempDir.path, 'hello', '.android', 'gradlew')),
|
||||
hostApp,
|
||||
);
|
||||
copy(
|
||||
new File(path.join(directory.path, 'hello', '.android', 'gradle', 'wrapper', 'gradle-wrapper.jar')),
|
||||
new File(path.join(tempDir.path, 'hello', '.android', 'gradle', 'wrapper', 'gradle-wrapper.jar')),
|
||||
new Directory(path.join(hostApp.path, 'gradle', 'wrapper')),
|
||||
);
|
||||
|
||||
@@ -177,7 +178,7 @@ Future<Null> main() async {
|
||||
} catch (e) {
|
||||
return new TaskResult.failure(e.toString());
|
||||
} finally {
|
||||
rmTree(directory);
|
||||
rmTree(tempDir);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,15 +77,23 @@ void fail(String message) {
|
||||
throw new BuildFailedError(message);
|
||||
}
|
||||
|
||||
void rm(FileSystemEntity entity) {
|
||||
if (entity.existsSync())
|
||||
entity.deleteSync();
|
||||
// Remove the given file or directory.
|
||||
void rm(FileSystemEntity entity, { bool recursive = false}) {
|
||||
if (entity.existsSync()) {
|
||||
// This should not be necessary, but it turns out that
|
||||
// on Windows it's common for deletions to fail due to
|
||||
// bogus (we think) "access denied" errors.
|
||||
try {
|
||||
entity.deleteSync(recursive: recursive);
|
||||
} on FileSystemException catch (error) {
|
||||
print('Failed to delete ${entity.path}: $error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Remove recursively.
|
||||
void rmTree(FileSystemEntity entity) {
|
||||
if (entity.existsSync())
|
||||
entity.deleteSync(recursive: true);
|
||||
rm(entity, recursive: true);
|
||||
}
|
||||
|
||||
List<FileSystemEntity> ls(Directory directory) => directory.listSync();
|
||||
@@ -414,7 +422,7 @@ Future<Null> getFlutter(String revision) async {
|
||||
section('Get Flutter!');
|
||||
|
||||
if (exists(flutterDirectory)) {
|
||||
rmTree(flutterDirectory);
|
||||
flutterDirectory.deleteSync(recursive: true);
|
||||
}
|
||||
|
||||
await inDirectory(flutterDirectory.parent, () async {
|
||||
|
||||
@@ -73,8 +73,7 @@ TaskFunction createBasicMaterialCompileTest() {
|
||||
const String sampleAppName = 'sample_flutter_app';
|
||||
final Directory sampleDir = dir('${Directory.systemTemp.path}/$sampleAppName');
|
||||
|
||||
if (await sampleDir.exists())
|
||||
rmTree(sampleDir);
|
||||
rmTree(sampleDir);
|
||||
|
||||
await inDirectory(Directory.systemTemp, () async {
|
||||
await flutter('create', options: <String>[sampleAppName]);
|
||||
|
||||
@@ -33,23 +33,24 @@ class PluginTest {
|
||||
|
||||
Future<TaskResult> call() async {
|
||||
section('Create Flutter project');
|
||||
final Directory tmp = await Directory.systemTemp.createTemp('plugin');
|
||||
final FlutterProject project = await FlutterProject.create(tmp, options);
|
||||
if (buildTarget == 'ios') {
|
||||
await prepareProvisioningCertificates(project.rootPath);
|
||||
}
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_plugin_test.');
|
||||
try {
|
||||
section('Add plugin');
|
||||
await project.addPlugin('path_provider');
|
||||
|
||||
section('Build');
|
||||
await project.build(buildTarget);
|
||||
|
||||
final FlutterProject project = await FlutterProject.create(tempDir, options);
|
||||
try {
|
||||
if (buildTarget == 'ios')
|
||||
await prepareProvisioningCertificates(project.rootPath);
|
||||
section('Add plugin');
|
||||
await project.addPlugin('path_provider');
|
||||
section('Build');
|
||||
await project.build(buildTarget);
|
||||
} finally {
|
||||
await project.delete();
|
||||
}
|
||||
return new TaskResult.success(null);
|
||||
} catch (e) {
|
||||
return new TaskResult.failure(e.toString());
|
||||
} finally {
|
||||
await project.delete();
|
||||
rmTree(tempDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,9 +98,9 @@ class FlutterProject {
|
||||
<String>['--stop'],
|
||||
canFail: true,
|
||||
);
|
||||
// TODO(mravn): Investigating if flakiness is timing dependent.
|
||||
// TODO(ianh): Investigating if flakiness is timing dependent.
|
||||
await new Future<Null>.delayed(const Duration(seconds: 10));
|
||||
}
|
||||
await parent.delete(recursive: true);
|
||||
rmTree(parent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ void createIndexAndCleanup() {
|
||||
void removeOldFlutterDocsDir() {
|
||||
try {
|
||||
new Directory('$kDocRoot/flutter').deleteSync(recursive: true);
|
||||
} catch (e) {
|
||||
} on FileSystemException {
|
||||
// If the directory does not exist, that's OK.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user