mirror of
https://github.com/Anvilcraft/modpacktools
synced 2024-05-19 11:54:20 +02:00
fix shell crashing on EOF
This commit is contained in:
parent
ea16f1cb41
commit
7ea555a472
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue