29 lines
899 B
Kotlin
29 lines
899 B
Kotlin
package scaffold
|
|
|
|
import com.github.ajalt.clikt.core.CliktCommand
|
|
import com.github.ajalt.clikt.core.subcommands
|
|
import scaffold.commands.GenerateCommand
|
|
import scaffold.commands.ListCommand
|
|
import scaffold.commands.NewCommand
|
|
import java.nio.file.Path
|
|
|
|
class Scaffold : CliktCommand() {
|
|
override fun run() {}
|
|
}
|
|
|
|
fun main(args: Array<String>) {
|
|
val configDirectory = when (System.getProperty("os.name")) {
|
|
"Linux" -> System.getenv("XDG_CONFIG_HOME")?.let { Path.of(it) }
|
|
?: Path.of(System.getProperty("user.home"), ".config")
|
|
else -> TODO("¯\\_(ツ)_/¯")
|
|
}
|
|
|
|
val scaffoldConfigDirectory = configDirectory.resolve("scaffold")
|
|
val generatorService = Generators(scaffoldConfigDirectory)
|
|
|
|
Scaffold().subcommands(
|
|
ListCommand(generatorService),
|
|
GenerateCommand(generatorService),
|
|
NewCommand(generatorService)
|
|
).main(args)
|
|
} |