Update command flow

Catch invalid server type befor creating provInstance
This commit is contained in:
erik 2022-08-17 14:46:46 +02:00
parent 6e2d669af5
commit 81350db43d

View file

@ -34,12 +34,11 @@ fun main(args: Array<String>) {
println("Application file not found. Please check if path is correct.") println("Application file not found. Please check if path is correct.")
exitProcess(1) exitProcess(1)
} }
val prov = createProvInstance(cmd.target)
if (!cmd.isValidServerType()) { if (!cmd.isValidServerType()) {
throw RuntimeException("Unknown serverType. Currently only k3s is accepted.") throw RuntimeException("Unknown serverType. Currently only k3s is accepted.")
} else { }
val prov = createProvInstance(cmd.target)
prov.provisionK3s(cmd as K3sCliCommand) prov.provisionK3s(cmd as K3sCliCommand)
}
} }