forked from firka/flutter
Remove dead ensureDirectoryExists (#76829)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user