Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f5903a91
Unverified
Commit
f5903a91
authored
Feb 26, 2021
by
Jenn Magder
Committed by
GitHub
Feb 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead ensureDirectoryExists (#76829)
parent
cc813bf1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
24 deletions
+0
-24
file_system.dart
packages/flutter_tools/lib/src/base/file_system.dart
+0
-14
file_system_test.dart
...utter_tools/test/general.shard/base/file_system_test.dart
+0
-10
No files found.
packages/flutter_tools/lib/src/base/file_system.dart
View file @
f5903a91
...
...
@@ -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
)
{
...
...
packages/flutter_tools/test/general.shard/base/file_system_test.dart
View file @
f5903a91
...
...
@@ -30,16 +30,6 @@ void main() {
);
});
testWithoutContext
(
'ensureDirectoryExists recursively creates a directory if it does not exist'
,
()
async
{
fsUtils
.
ensureDirectoryExists
(
'foo/bar/baz.flx'
);
expect
(
fs
.
isDirectorySync
(
'foo/bar'
),
true
);
});
testWithoutContext
(
'ensureDirectoryExists throws tool exit on failure to create'
,
()
async
{
fs
.
file
(
'foo'
).
createSync
();
expect
(()
=>
fsUtils
.
ensureDirectoryExists
(
'foo/bar.flx'
),
throwsToolExit
());
});
testWithoutContext
(
'getUniqueFile creates a unique file name'
,
()
async
{
final
File
fileA
=
fsUtils
.
getUniqueFile
(
fs
.
currentDirectory
,
'foo'
,
'json'
)
..
createSync
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment