Remove dead ensureDirectoryExists (#76829)

This commit is contained in:
Jenn Magder
2021-02-25 18:11:01 -08:00
committed by GitHub
parent cc813bf153
commit f5903a91e0
2 changed files with 0 additions and 24 deletions

View File

@@ -8,7 +8,6 @@ import 'package:file/file.dart';
import 'package:file/local.dart' as local_fs;
import 'package:meta/meta.dart';
import 'common.dart' show throwToolExit;
import 'io.dart';
import 'platform.dart';
import 'process.dart';
@@ -41,19 +40,6 @@ class FileSystemUtils {
final Platform _platform;
/// Create the ancestor directories of a file path if they do not already exist.
void ensureDirectoryExists(String filePath) {
final String dirPath = _fileSystem.path.dirname(filePath);
if (_fileSystem.isDirectorySync(dirPath)) {
return;
}
try {
_fileSystem.directory(dirPath).createSync(recursive: true);
} on FileSystemException catch (e) {
throwToolExit('Failed to create directory "$dirPath": ${e.osError.message}');
}
}
/// Appends a number to a filename in order to make it unique under a
/// directory.
File getUniqueFile(Directory dir, String baseName, String ext) {