mirror of
https://github.com/Anvilcraft/modpacktools
synced 2024-06-10 22:49:26 +02:00
Compare commits
2 commits
3fbd93a519
...
7ea555a472
Author | SHA1 | Date | |
---|---|---|---|
LordMZTE | 7ea555a472 | ||
LordMZTE | ea16f1cb41 |
|
@ -19,12 +19,16 @@ object Shell : AbstractCommand("Shell") {
|
||||||
override fun execute(args: Namespace): CommandReturn {
|
override fun execute(args: Namespace): CommandReturn {
|
||||||
println("enter \'exit\' to exit the shell\n")
|
println("enter \'exit\' to exit the shell\n")
|
||||||
|
|
||||||
while(true) {
|
var continueLoop = true
|
||||||
|
while(continueLoop) {
|
||||||
fPrint(">>>", TERMC.bold, TERMC.cyan)
|
fPrint(">>>", TERMC.bold, TERMC.cyan)
|
||||||
val arg = readLine()!!.split(' ')
|
readLine()?.let {
|
||||||
if(arg.getOrNull(0) == "exit")
|
val arg = it.split(' ')
|
||||||
break
|
if(arg.getOrNull(0) == "exit")
|
||||||
runCommand(arg.toTypedArray())
|
continueLoop = false
|
||||||
|
else
|
||||||
|
runCommand(arg.toTypedArray())
|
||||||
|
} ?: run { continueLoop = false }
|
||||||
}
|
}
|
||||||
return success()
|
return success()
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,12 @@ fun Path.toZip(zStream: ZipOutputStream) {
|
||||||
zStream.closeEntry()
|
zStream.closeEntry()
|
||||||
return FileVisitResult.CONTINUE
|
return FileVisitResult.CONTINUE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun preVisitDirectory(dir: Path, attrs: BasicFileAttributes?): FileVisitResult {
|
||||||
|
zStream.putNextEntry(ZipEntry(this@toZip.relativize(dir).toString()))
|
||||||
|
zStream.closeEntry()
|
||||||
|
return FileVisitResult.CONTINUE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue