Add version to socket path to avoid problems after version update
This commit is contained in:
parent
d33106431d
commit
a05a12dbec
1 changed files with 2 additions and 0 deletions
|
|
@ -21,10 +21,12 @@ lazy_static! {
|
||||||
pub static ref ZELLIJ_PROJ_DIR: ProjectDirs =
|
pub static ref ZELLIJ_PROJ_DIR: ProjectDirs =
|
||||||
ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap();
|
ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap();
|
||||||
pub static ref ZELLIJ_IPC_PIPE: PathBuf = {
|
pub static ref ZELLIJ_IPC_PIPE: PathBuf = {
|
||||||
|
let version = std::env::var("CARGO_PKG_VERSION").unwrap();
|
||||||
let mut ipc_dir = ZELLIJ_PROJ_DIR
|
let mut ipc_dir = ZELLIJ_PROJ_DIR
|
||||||
.runtime_dir()
|
.runtime_dir()
|
||||||
.map(|p| p.to_owned())
|
.map(|p| p.to_owned())
|
||||||
.unwrap_or_else(|| PathBuf::from("/tmp/zellij-".to_string() + &format!("{}", *UID)));
|
.unwrap_or_else(|| PathBuf::from("/tmp/zellij-".to_string() + &format!("{}", *UID)));
|
||||||
|
ipc_dir.push(&version);
|
||||||
std::fs::create_dir_all(&ipc_dir).unwrap();
|
std::fs::create_dir_all(&ipc_dir).unwrap();
|
||||||
ipc_dir.push(&*SESSION_NAME);
|
ipc_dir.push(&*SESSION_NAME);
|
||||||
ipc_dir
|
ipc_dir
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue