diff --git a/yazi-dds/src/stream.rs b/yazi-dds/src/stream.rs index 3e1b6b8d..4b2915da 100644 --- a/yazi-dds/src/stream.rs +++ b/yazi-dds/src/stream.rs @@ -55,16 +55,16 @@ impl Stream { async fn socket_file() -> io::Result<&'static std::path::PathBuf> { use tokio::{fs::DirBuilder, sync::OnceCell}; use yazi_fs::Xdg; - static ONCE: tokio::sync::OnceCell = OnceCell::const_new(); + static ONCE: tokio::sync::OnceCell = OnceCell::const_new(); ONCE .get_or_try_init(|| async move { let p = Xdg::runtime_dir(); #[cfg(unix)] - DirBuilder::new().recursive(true).create(p).await?; - #[cfg(not(unix))] DirBuilder::new().mode(0o700).recursive(true).create(p).await?; + #[cfg(not(unix))] + DirBuilder::new().recursive(true).create(p).await?; Ok(p.join(".dds.sock")) }) diff --git a/yazi-fs/src/xdg.rs b/yazi-fs/src/xdg.rs index 0d96cb04..a2291c83 100644 --- a/yazi-fs/src/xdg.rs +++ b/yazi-fs/src/xdg.rs @@ -25,17 +25,15 @@ impl Xdg { #[cfg(windows)] { - dirs::config_dir() - .map(|p| p.join("yazi").join("config")) - .expect("Failed to get config directory") + dirs::config_dir().map(|p| p.join("yazi\\config")).expect("Failed to get config directory") } #[cfg(unix)] { env::var_os("XDG_CONFIG_HOME") .map(PathBuf::from) .filter(|p| p.is_absolute()) - .or_else(|| dirs::home_dir().map(|h| h.join(".config"))) .map(|p| p.join("yazi")) + .or_else(|| dirs::home_dir().map(|h| h.join(".config/yazi"))) .expect("Failed to get config directory") } } @@ -55,8 +53,8 @@ impl Xdg { env::var_os("XDG_CACHE_HOME") .map(PathBuf::from) .filter(|p| p.is_absolute()) - .or_else(|| dirs::home_dir().map(|h| h.join(".cache"))) .map(|p| p.join("yazi")) + .or_else(|| dirs::home_dir().map(|h| h.join(".cache/yazi"))) .expect("Failed to get state directory") } }