Open nanodeath opened 3 months ago
This seems to happen around here:
I thought perhaps I could just read in what was already on disk and write it back if it's different, but sometimes the data is in a different order:
Maybe that data was not used LinkedHashMap before and now it is, or...something else. If we know these lists aren't actually order-sensitive, we could sort them and then compare, but we'd have to do that recursively, which would be a pain. If we're operating on Jackson nodes instead of custom types, it wouldn't be quite as bad, but still a bit mind-numbing :slightly_smiling_face:
The better long-term fix here would be basically to avoid writing back into assets
at runtime at all; treat it as read-only. I'm going to see about writing these back into the application's write area (which at least on Linux is currently directly under the home directory?? but that's another issue), and then update whatever's reading these files to check both locations.
There's a few[1] files in
assets/
that seem to get regenerated on every build or something. There's probably some optimization possible to not to that, or do that smarter or something, but the main pain point for me is the Git churn; generated files generally shouldn't be in source control.The most logical option to me would be to update their paths to be
core/assets/generated/*
and then add that to .gitignore, but there might be a better way.(ignore GlobalSettings.java there) 1:![image](https://github.com/rossturner/king-under-the-mountain/assets/10625/dd143237-fef7-4072-9ddd-095021776cfe)