Mountain/IPC/WindServiceHandlers/Utilities/UserdataDir/Get.rs
1
2//! Returns the userdata base directory, falling back to platform defaults.
3
4pub fn Fn() -> String {
5 if let Some(Dir) = super::BASE_DIR.get() {
6 return Dir.clone();
7 }
8
9 if let Ok(Home) = std::env::var("HOME") {
10 #[cfg(target_os = "macos")]
11 return format!("{}/Library/Application Support/Land", Home);
12
13 #[cfg(target_os = "linux")]
14 return format!("{}/.local/share/Land", Home);
15 }
16
17 "/tmp/Land".to_string()
18}