Expand globs for templates + files & Add default prompt value

This commit is contained in:
2021-04-02 12:17:59 +02:00
parent 7a7ebe724e
commit 6e1e82c2c5
8 changed files with 52 additions and 40 deletions
+11 -1
View File
@@ -4,5 +4,15 @@ import com.github.ajalt.clikt.core.CliktCommand
import scaffold.Generators
class ListCommand(private val generators: Generators) : CliktCommand("list") {
override fun run() = echo(generators.findAll().joinToString(" ") { it.last().toString() })
override fun run() {
val generators = generators.findAll()
if (generators.isEmpty()) {
echo("No generators yet, you can create one with `scaffold new`")
} else {
generators.forEach {
echo(it.last())
}
}
}
}