Files
STARTLINER/rust/src/modules/bepinex.rs
2025-03-16 17:55:38 +00:00

22 lines
616 B
Rust

use anyhow::Result;
use ini::Ini;
use crate::{model::profile::BepInEx, profiles::ProfilePaths};
impl BepInEx {
pub fn line_up(&self, p: &impl ProfilePaths) -> Result<()> {
let dir = p.data_dir().join("BepInEx");
if dir.exists() && dir.is_dir() {
let dir = dir.join("config");
std::fs::create_dir_all(&dir)?;
let mut ini = Ini::new();
ini.with_section(Some("Logging.Console"))
.set("Enabled", if self.console { "true" } else { "false" });
ini.write_to_file(dir.join("BepInEx.cfg"))?;
}
Ok(())
}
}