Ported forward additional changes for TaskOutputsBackup.

^KT-49782 Fixed
This commit is contained in:
Yahor Berdnikau
2021-12-03 13:44:34 +01:00
committed by teamcity
parent 550f5cf776
commit 699671cb82
@@ -44,7 +44,7 @@ internal class TaskOutputsBackup(
// property. To avoid snapshot sync collisions, each snapshot output directory has also 'index' as prefix.
outputs.toSortedSet().forEachIndexed { index, outputPath ->
val pathInSnapshot = "$index${File.separator}${outputPath.pathRelativeToBuildDirectory}"
if (outputPath.isDirectory) {
if (outputPath.isDirectory && Files.list(outputPath.toPath()).use { it.findFirst().isPresent }) {
snapshotsDir
.map { it.file(pathInSnapshot) }
.get()
@@ -121,7 +121,6 @@ internal class TaskOutputsBackup(
zip.closeEntry()
}
zip.flush()
zip.close()
}
}