4
0
Fork 0
mirror of https://github.com/Anvilcraft/modpacktools synced 2024-05-19 11:54:20 +02:00

Compare commits

...

2 commits

Author SHA1 Message Date
LordMZTE 7ea555a472 fix shell crashing on EOF 2021-02-12 18:23:00 +01:00
LordMZTE ea16f1cb41 fix Path.toZip missing directory entries 2021-02-12 17:45:54 +01:00
3 changed files with 15 additions and 5 deletions

0
gradlew vendored Normal file → Executable file
View file

View file

@ -19,12 +19,16 @@ object Shell : AbstractCommand("Shell") {
override fun execute(args: Namespace): CommandReturn {
println("enter \'exit\' to exit the shell\n")
while(true) {
var continueLoop = true
while(continueLoop) {
fPrint(">>>", TERMC.bold, TERMC.cyan)
val arg = readLine()!!.split(' ')
if(arg.getOrNull(0) == "exit")
break
runCommand(arg.toTypedArray())
readLine()?.let {
val arg = it.split(' ')
if(arg.getOrNull(0) == "exit")
continueLoop = false
else
runCommand(arg.toTypedArray())
} ?: run { continueLoop = false }
}
return success()
}

View file

@ -128,6 +128,12 @@ fun Path.toZip(zStream: ZipOutputStream) {
zStream.closeEntry()
return FileVisitResult.CONTINUE
}
override fun preVisitDirectory(dir: Path, attrs: BasicFileAttributes?): FileVisitResult {
zStream.putNextEntry(ZipEntry(this@toZip.relativize(dir).toString()))
zStream.closeEntry()
return FileVisitResult.CONTINUE
}
}
)
}