continue->next in Ruby script (#104296)

This commit is contained in:
Jenn Magder
2022-05-23 18:43:05 -07:00
committed by GitHub
parent 8dc5121894
commit c5d046c00c
4 changed files with 50 additions and 23 deletions

View File

@@ -18,19 +18,19 @@ import 'package:test_api/test_api.dart' hide test; // ignore: deprecated_member_
export 'package:test_api/test_api.dart' hide test, isInstanceOf; // ignore: deprecated_member_use
void tryToDelete(Directory directory) {
void tryToDelete(FileSystemEntity fileEntity) {
// 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 {
if (directory.existsSync()) {
directory.deleteSync(recursive: true);
if (fileEntity.existsSync()) {
fileEntity.deleteSync(recursive: true);
}
} on FileSystemException catch (error) {
// We print this so that it's visible in the logs, to get an idea of how
// common this problem is, and if any patterns are ever noticed by anyone.
// ignore: avoid_print
print('Failed to delete ${directory.path}: $error');
print('Failed to delete ${fileEntity.path}: $error');
}
}