mirror of
https://github.com/revanced/revanced-cli.git
synced 2025-01-05 16:55:50 +01:00
refactor: prevent any future regressions in zipfs
This commit is contained in:
parent
c272d55e2d
commit
f3a3e935a2
@ -13,6 +13,10 @@ internal class ZipFileSystemUtils(
|
||||
private var zipFileSystem = FileSystems.newFileSystem(file.toPath(), mapOf("noCompression" to true))
|
||||
|
||||
private fun Path.deleteRecursively() {
|
||||
if (!Files.exists(this)) {
|
||||
throw IllegalStateException("File exists in real folder but not in zip file system")
|
||||
}
|
||||
|
||||
if (Files.isDirectory(this)) {
|
||||
Files.list(this).forEach { path ->
|
||||
path.deleteRecursively()
|
||||
|
Loading…
Reference in New Issue
Block a user