Protect the deletion of the local engine temp dir in case it is already deleted (#57345)
This commit is contained in:
@@ -1001,8 +1001,11 @@ Directory _getLocalEngineRepo({
|
||||
.createTempSync('flutter_tool_local_engine_repo.');
|
||||
|
||||
// Remove the local engine repo before the tool exits.
|
||||
shutdownHooks.addShutdownHook(
|
||||
() => localEngineRepo.deleteSync(recursive: true),
|
||||
shutdownHooks.addShutdownHook(() {
|
||||
if (localEngineRepo.existsSync()) {
|
||||
localEngineRepo.deleteSync(recursive: true);
|
||||
}
|
||||
},
|
||||
ShutdownStage.CLEANUP,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user