diff options
author | Jonathan LEI <xJonathan@outlook.com> | 2022-11-08 23:39:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-08 16:39:30 +0100 |
commit | 6c79ff9b31e72fabaca0288d5ec39d0250fc6f0b (patch) | |
tree | b156795d9c19393f5302385af771bcd74f5c3ff6 | |
parent | 1bb12e720e1169c846adb2ffdeb8e0f3163288ee (diff) |
fix: use `temp_dir` for getting temp folder (#1898)
-rw-r--r-- | zellij-utils/src/consts.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zellij-utils/src/consts.rs b/zellij-utils/src/consts.rs index 52e2f2369..964938131 100644 --- a/zellij-utils/src/consts.rs +++ b/zellij-utils/src/consts.rs @@ -45,7 +45,7 @@ mod unix_only { use crate::shared::set_permissions; use lazy_static::lazy_static; use nix::unistd::Uid; - use std::fs; + use std::{env::temp_dir, fs}; lazy_static! { static ref UID: Uid = Uid::current(); @@ -56,7 +56,7 @@ mod unix_only { sock_dir.push(envs::get_session_name().unwrap()); sock_dir }; - pub static ref ZELLIJ_TMP_DIR: PathBuf = PathBuf::from(format!("/tmp/zellij-{}", *UID)); + pub static ref ZELLIJ_TMP_DIR: PathBuf = temp_dir().join(format!("zellij-{}", *UID)); pub static ref ZELLIJ_TMP_LOG_DIR: PathBuf = ZELLIJ_TMP_DIR.join("zellij-log"); pub static ref ZELLIJ_TMP_LOG_FILE: PathBuf = ZELLIJ_TMP_LOG_DIR.join("zellij.log"); pub static ref ZELLIJ_SOCK_DIR: PathBuf = { |