aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-11-13Enable LTO for release buildsHEADmasterDaniel Schadt
The speedup we might get is not too important, but the smaller binary size is nice to have (currently, down from ~15 MiB to ~8 MiB).
2021-11-13Properly extract mod name from path for legacy modDaniel Schadt
We introduced the change to make MineMod compatible with mods that do not have a mod.conf, but we forgot that read_conf()? will just make the function return early in that case - and the fallback value is never used. This change makes it so that read_conf() is only called when a mod.conf exists, which has the benefit that we get the legacy name resolution for mods without mod.conf, but if there are I/O errors while reading the config, we will still propagate them properly (same as dependencies()).
2021-11-12Add a manpage and more to the READMEDaniel Schadt
2021-11-12More colors!Daniel Schadt
The user_choice() function was a bit weird because it needed a "formatted" item for every item to select (not using the Display of the item), but it also didn't support colored output. This change fixes that by introducing a new trait that does colored output and by making user_choice() use that trait to output the lines.
2021-11-10Implement basic support for git fetchingDaniel Schadt
This allows mods to be installed via a git repository URL, such as git+https://gitlab.com/...
2021-11-10implement support for multiline descriptionsDaniel Schadt
Key-Value-Stores are not always as easy as every line containing a key-value pair, there is also the variant that a value spans multiple lines and is enclosed in """ (e.g. the description of some mods). This also changes the API slightly, as we want to separate the parsing code from the code that reads the file. This makes it easier to do testing or to re-use the code for data that is already in-memory. Therefore, kvstore::write now takes a writer and kvstore::save provides the functionality that the old kvstore::write had.
2021-11-09fix the doctestDaniel Schadt
2021-11-09support the legacy style of modsDaniel Schadt
Those mods might not have a mod.conf and instead define their dependencies in depends.txt. A lot of mods in mineclone2 for example still do that.
2021-11-09move install code to own moduleDaniel Schadt
2021-11-09enable SubcommandRequired & ColoredHelpDaniel Schadt
Especially SubcommandRequired is helpful, as without one, we're not doing all that much.
2021-11-09implement a simple directory installerDaniel Schadt
2021-11-09split mod install logicDaniel Schadt
Previously, install_mod was a huge function that did a lot of things at once. Not only did it do the actual mod copying, it also had the dependency resolution, user interaction, ... Now, we've split the code and made it more re-usable. The dependency resolution is done in Baas::install, with special "hooks" being given in baas::Installer that allow a consumer to customize the installation and embed the user interaction there. The code itself is pretty much the same, it is just split up now.
2021-11-09add a note about documentation to the readmeDaniel Schadt
2021-11-09Separate the binary and libraryDaniel Schadt
This uses the workspace feature of cargo, with the benefit that 1) We can more cleanly group the binary (user facing) code from the library 2) We can have dependencies that apply to the binary only The first point could've been achieved without workspaces (Cargo supports both binaries and libraries in a crate), but the second point is what really makes this approach a lot better.
2021-11-09more documentationDaniel Schadt
2021-11-09Rename --fix-permissions to --chownDaniel Schadt
On second thought, we're just calling chown, so let's call it that.
2021-11-09Add some command line help textsDaniel Schadt
2021-11-09add -p flag to fix permissionsDaniel Schadt
This is useful if you run modderbaas as root but want the resulting directories to be owned by the right uid/gid.
2021-11-07remove fs_extra crateDaniel Schadt
The function that we needed from there is very small and easily implemented ourselves. On the other hand, fs_extra seemed to have some weird options going on and implemented the copy in a bit of a roundabout manner.
2021-11-07use fallback world nameDaniel Schadt
Apparently, the default world of minetest-server does not have a name set (which is kind of okay because it is the only existing world anyway). But ModderBaas needs to deal with this situation properly. In this case, we simply take the directory name, similar to games.
2021-11-07make downloads work with more archivesDaniel Schadt
Some mods do not come bundled in a separate directory, so we also support archives that do not contain an inner directory now (e.g. the "charcoal" mod).
2021-11-06support installing modpacksDaniel Schadt
2021-11-06add a dry-run mode to installDaniel Schadt
2021-11-06Initial commitDaniel Schadt
This is the inital commit of a somewhat working version.