[1.10.2 - 1.61-58] No backup of InvTweaksTree created on XML error
neoc666 opened this issue ยท 4 comments
Minecraft Version: 1.10.2
Inventory Tweaks Version: 1.61-58
If you edit the tree file and don't close an XML tag properly, all files are reverted to the defaults. Backups are created for InvTweaks.cfg and InvTweaksRules.txt, but not for InvTweaksTree.txt.
I see that it should, see: https://github.com/Inventory-Tweaks/inventory-tweaks/blob/develop/src/main/java/invtweaks/InvTweaksConfigManager.java#L194
These backup attempts have been known to be a bit screwy in the past though, try looking around other folders for it.
Couldn't find any backup file, up to my Win7 Documents folder (Curse is in there). Maybe it is a bit harsh to overwrite files in case there is a syntax error? I would prefer the mod failing instead. Or you could extract the original files with a special extension and only copy or rename them if there is no other file with the destination name. So if parsing a file from the archive without extracting it to the file system is too much effort, you could just parse that original file in case of an error.
It's a bit of a big project to heavily redo the configuration loading to not require the replacement, but I added a log entry that should show full paths when a file needs to be backed up.