mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-30 06:37:29 +00:00
refactor(config): 改进了数据目录的获取方式.
补充了通过 user.dir 获取目录路径的方式.
This commit is contained in:
parent
bc0f3be32c
commit
4210efef3b
@ -160,7 +160,10 @@ internal enum class AppPaths(
|
|||||||
* 提示: 结尾不带 `/`.
|
* 提示: 结尾不带 `/`.
|
||||||
*/
|
*/
|
||||||
DATA_ROOT(fileSupplier = {
|
DATA_ROOT(fileSupplier = {
|
||||||
File(System.getProperty(PathConst.PROP_DATA_PATH) ?: System.getenv(PathConst.ENV_DATA_PATH) ?: ".")
|
File(
|
||||||
|
System.getProperty(PathConst.PROP_DATA_PATH) ?: System.getenv(PathConst.ENV_DATA_PATH)
|
||||||
|
?: System.getProperty("user.dir") ?: "."
|
||||||
|
)
|
||||||
}, initializer = {
|
}, initializer = {
|
||||||
val f = file
|
val f = file
|
||||||
if (!f.exists()) {
|
if (!f.exists()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user