Skip to main content

enable_mod

Function enable_mod 

Source
pub fn enable_mod(
    profile: &GameProfile,
    profile_dir: &Path,
    mod_name: &str,
) -> Result<()>
Available on crate feature io only.
Expand description

Enables an installed mod: strips .old from its Subdir-tracked files and restores its State-tracked files by copying them back from the cache sources recorded in the _state file.

§Errors

Error::Install before anything is touched if the _state file names a destination outside profile_dir, or a source that is not a file of the same name in this mod’s own package cache (.../cache/<mod_name>/...), so a tampered or imported record cannot copy any other file into the profile.