1
Fork 0
mirror of https://github.com/redstrate/LauncherTweaks.git synced 2025-05-20 17:37:46 +00:00
launchertweaks/src/config.rs

16 lines
405 B
Rust
Raw Normal View History

2025-04-19 23:10:11 -04:00
use serde::Deserialize;
#[derive(Deserialize, Default)]
2025-04-19 23:10:11 -04:00
pub struct Config {
pub launcher_url: Option<String>,
pub winhttp_proxy: Option<String>,
2025-04-19 23:10:11 -04:00
}
pub fn get_config() -> Config {
std::env::current_exe()
.ok()
.and_then(|p| std::fs::read_to_string(p.join("../launchertweaks.toml")).ok())
.and_then(|s| toml::from_str::<Config>(&s).ok())
.unwrap_or_default()
}