Expand description
The mods.yml model and its read/write.
The mods.yml model and its read/write.
mods.yml is a YAML array of ProfileMod and is the authoritative record
of what is installed in a profile. The shape mirrors r2modman’s ManifestV2
so r2modman can read a profile this engine produced: keys are camelCase, the
icon field is never written, and versionNumber is a nested object.
Structs§
- Profile
Mod - One installed mod, mirroring r2modman’s
ManifestV2. Field order matches r2modman’s declaration order;iconis never serialized. - SemVer
- The
major.minor.patchversion object, serialized as a nested mapping to match r2modman’sVersionNumber.
Functions§
- find
- Finds an installed mod by its
Owner-Nameidentifier. - now_
millis - The current time in the epoch-millisecond encoding
ProfileMod::installed_at_timerecords, matching r2modman’sinstalledAtTime. - read
- Reads
<profile_dir>/mods.yml. A missing file is an empty list (a fresh profile), matching r2modman treating an absent list as[]. - upsert
- Inserts
entry, replacing any existing entry with the samename. - write
- Writes
modsto<profile_dir>/mods.yml, creating the directory if needed.