[K/N] Fixed problem with non-empty output directory
This commit is contained in:
+2
-1
@@ -41,7 +41,8 @@ internal class CacheStorage(val context: Context) {
|
|||||||
val outputFiles = context.config.outputFiles
|
val outputFiles = context.config.outputFiles
|
||||||
// For caches the output file is a directory. It might be created by someone else,
|
// For caches the output file is a directory. It might be created by someone else,
|
||||||
// we have to delete it in order for the next renaming operation to succeed.
|
// we have to delete it in order for the next renaming operation to succeed.
|
||||||
outputFiles.mainFile.delete()
|
// TODO: what if the directory is not empty?
|
||||||
|
java.io.File(outputFiles.mainFileName).delete()
|
||||||
if (!outputFiles.tempCacheDirectory!!.renameTo(outputFiles.mainFile))
|
if (!outputFiles.tempCacheDirectory!!.renameTo(outputFiles.mainFile))
|
||||||
outputFiles.tempCacheDirectory.deleteRecursively()
|
outputFiles.tempCacheDirectory.deleteRecursively()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user