use once_cell::sync::Lazy;
type LazyString = Lazy<String>;
pub(crate) static MINECRAFT_PATH: LazyString = Lazy::new(|| {
#[cfg(target_os = "windows")]
{
".minecraft".into()
}
#[cfg(any(target_os = "macos", target_os = "linux"))]
{
if let Some(dir) = dirs::home_dir() {
dir.join(".minecraft").to_str().unwrap().to_string()
} else {
"~/.minecraft".into()
}
}
});
pub(crate) static MINECRAFT_ASSETS_PATH: LazyString =
Lazy::new(|| format!("{}/assets", MINECRAFT_PATH.as_str()));
pub(crate) static MINECRAFT_LIBRARIES_PATH: LazyString =
Lazy::new(|| format!("{}/libraries", MINECRAFT_PATH.as_str()));
pub(crate) static MINECRAFT_VERSIONS_PATH: LazyString =
Lazy::new(|| format!("{}/versions", MINECRAFT_PATH.as_str()));