File tree Expand file tree Collapse file tree
src/main/kotlin/co/statu/parsek/api/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,11 +103,13 @@ class PluginConfigManager<T : PluginConfig>(
103103 updateConfig(JsonObject (config.root().unwrapped()))
104104 }
105105
106- private fun migrate (configVersion : Int = config.version, saveConfig : Boolean = false) {
106+ private fun migrate (
107+ configAsJsonObject : JsonObject = JsonObject (gson.toJson(config)),
108+ configVersion : Int = config.version,
109+ saveConfig : Boolean = false
110+ ) {
107111 logger.info(" Checking available config migrations" )
108112
109- val configAsJsonObject = JsonObject (gson.toJson(config))
110-
111113 migrations
112114 .find { configMigration -> configMigration.isMigratable(configVersion) }
113115 ?.let { migration ->
@@ -117,7 +119,7 @@ class PluginConfigManager<T : PluginConfig>(
117119
118120 migration.migrate(configAsJsonObject)
119121
120- migrate(migration.to, true )
122+ migrate(configAsJsonObject, migration.to, true )
121123
122124 return
123125 }
You can’t perform that action at this time.
0 commit comments