Apply style guide regarding createTempSync pattern (#81090)

This commit is contained in:
Ian Hickson
2021-04-27 14:59:03 -07:00
committed by GitHub
parent a7eb2c8a1a
commit 6beafa7b16
23 changed files with 33 additions and 50 deletions

View File

@@ -218,9 +218,8 @@ class LocalFileSystem extends local_fs.LocalFileSystem {
@override
Directory get systemTempDirectory {
if (_systemTemp == null) {
_systemTemp = super.systemTempDirectory.createTempSync(
'flutter_tools.',
)..createSync(recursive: true);
_systemTemp = super.systemTempDirectory.createTempSync('flutter_tools.')
..createSync(recursive: true);
// Make sure that the temporary directory is cleaned up if the tool is
// killed by a signal.
for (final ProcessSignal signal in _fatalSignals) {

View File

@@ -419,9 +419,7 @@ class AndroidMavenArtifacts extends ArtifactSet {
if (globals.androidSdk == null) {
return;
}
final Directory tempDir = cache.getRoot().createTempSync(
'flutter_gradle_wrapper.',
);
final Directory tempDir = cache.getRoot().createTempSync('flutter_gradle_wrapper.');
globals.gradleUtils.injectGradleWrapperIfNeeded(tempDir);
final Status status = logger.startProgress('Downloading Android Maven dependencies...');

View File

@@ -156,7 +156,7 @@ class FlutterTesterDevice extends Device {
}
final Directory assetDirectory = _fileSystem.systemTempDirectory
.createTempSync('flutter-tester');
.createTempSync('flutter_tester.');
final String applicationKernelFilePath = getKernelPathForTransformerOptions(
_fileSystem.path.join(assetDirectory.path, 'flutter-tester-app.dill'),
trackWidgetCreation: buildInfo.trackWidgetCreation,