[IC] Fix non-existing file removal in CompilationTransaction

#KT-49785 In Progress
This commit is contained in:
Alexander Likhachev
2022-12-07 16:32:29 +01:00
committed by Space Team
parent 82a2cac4d6
commit bb51522cac
@@ -95,11 +95,12 @@ class RecoverableCompilationTransaction(
* Moves the original [outputFile] to the [stashDir] instead of deleting.
*/
override fun deleteFile(outputFile: Path) {
if (!Files.exists(outputFile)) {
return
}
if (isFileRelocationIsAlreadyRegisteredFor(outputFile)) {
if (Files.exists(outputFile)) {
reporter.debug { "Deleting $outputFile" }
Files.delete(outputFile)
}
reporter.debug { "Deleting $outputFile" }
Files.delete(outputFile)
return
}
reporter.measure(BuildTime.PRECISE_BACKUP_OUTPUT) {