Skip to content

Commit

Permalink
always write back configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Nov 10, 2023
1 parent 6fc9986 commit 06ad0dd
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,11 @@ class ConfigManager(
val configName = configFile.nameWithoutExtension
try {
val node = loader.load()
val upgradeResult = upgradeNode(upgrader, node, configTypeName, configName)
upgradeNode(upgrader, node, configTypeName, configName)
val loadedConfiguration = factory.loadFrom(node, configName)
loadedConfiguration.saveTo(node)
result[configName] = loadedConfiguration
if (upgradeResult.didUpgrade) {
loader.save(node)
}
loader.save(node)
} catch (ex: Exception) {
throw IllegalArgumentException("Failed to load $configTypeName config: ${configFile.name}. This is likely due to an invalid config file.", ex)
}
Expand Down

0 comments on commit 06ad0dd

Please sign in to comment.