refactor(launch): 更改初始化配置中, 退出进程的时机.

为了能在单元测试中检查 initialFiles 是否正常, 故将 exitProcess 移到 main 方法中, 方便进行测试.
This commit is contained in:
2022-07-12 00:27:18 +08:00
parent 7f7b2b8895
commit 8c4e48e3eb
2 changed files with 11 additions and 4 deletions

View File

@ -30,7 +30,9 @@ fun main(args: Array<String>): Unit = runBlocking {
log.info { "ScalaBot 正在启动中..." }
log.info { "数据目录: ${AppPaths.DATA_ROOT}" }
log.debug { "启动参数: ${args.joinToString(prefix = "[", postfix = "]")}" }
initialFiles()
if (initialFiles()) {
exitProcess(1)
}
val launcher = Launcher()
.registerShutdownHook()