File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
common/src/main/kotlin/com/lambda/config Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ abstract class Configuration : Jsonable {
6262 get() = File (" ${primary.parent} /${primary.nameWithoutExtension} -backup.${primary.extension} " )
6363
6464 init {
65- listenUnsafe< ClientEvent . Startup > { tryLoad() }
65+ tryLoad() // ToDo: This will do at the moment but i'd like to run this at the first first loadable stage
6666 listenUnsafe<ClientEvent .Shutdown >(Int .MIN_VALUE ) { trySave() }
6767
6868 register()
@@ -96,11 +96,11 @@ abstract class Configuration : Jsonable {
9696 }
9797
9898 fun save () = runCatching {
99- primary.createIfNotExists {
100- it.parentFile.mkdirs()
101- it.writeText(gson.toJson(toJson()))
102- it.copyTo(backup, true )
103- }
99+ primary.createIfNotExists()
100+ . let {
101+ it.writeText(gson.toJson(toJson()))
102+ it.copyTo(backup, true )
103+ }
104104 }
105105
106106 /* *
You can’t perform that action at this time.
0 commit comments