ronoaldo / minetools

Utilities for Minetest server management
GNU Lesser General Public License v2.1
19 stars 1 forks source link

Add ability to skip files #7

Open squidink7 opened 1 year ago

squidink7 commented 1 year ago

I use this tool to update the mods on my server, however I've also manually added skins to the skinsdb mod, and every time it updates, it erases all the custom skins. If possible it would be lovely to have a way to whitelist files so they don't get overwritten when the mod updates.

ronoaldo commented 1 year ago

Hi! Thank you so much for letting me know that you find it useful. I can definitely add that.

My understanding is that the skinsdb mod should write data to the world folder instead of the mod folder, because even if you update using the Minetest Client (I think) it would erase all skins. The way I handle this issue on my server is like this: I have downloaded all skins on a separate folder and then I manually copy over the skins to the mod folder after an update. This way the mod "code" is separated from the downloaded skins, and I don't need to redownload all data each update.

Do you have any ideas on how it would work for you? This is a suggestion of the feature/usage:

contentdb install --udpate --keep=mods/skinsdb/textures/** skinsdb

The --keep flag contains a glob-like pattern to keep before removing the mod folder during an update. It could then be repeated multiple times to keep multiple patterns/folders/files. Additionally, a configuration file (by default at ~/.config/contentdb.ini) could be read with options that you always want to be used each invocation, to avoid having to pass a huge command line each update. The file contents could be like this:

$ cat ~/.config/contentdb.ini
keep=mods/skinsdb/textures/**

Would that work for your use case?

squidink7 commented 1 year ago

That sounds perfect! thank you so much! My only suggestion is that maybe the config file could also be per-mod, so that if you uninstall the mod, all mod specific lines can be deleted as well and you wouldn't have to edit your global config. Also, thank you again for working on this wonderful tool! I have no idea how else I'd manage my headless server, as minetest's gui won't work there.