diff options
| author | henil <dedaniahenil@gmail.com> | 2021-02-10 12:22:15 +0530 |
|---|---|---|
| committer | henil <dedaniahenil@gmail.com> | 2021-02-10 12:22:15 +0530 |
| commit | af95b3ff9a7a53a5c25aa49f04756945f1dbf634 (patch) | |
| tree | 76f934c8a4414bc2effb9865a854740a1b095ae9 /src/common/utils | |
| parent | Update references of mosaic to Zellij in md files (diff) | |
| download | sl0ppij-af95b3ff9a7a53a5c25aa49f04756945f1dbf634.tar.gz sl0ppij-af95b3ff9a7a53a5c25aa49f04756945f1dbf634.tar.xz sl0ppij-af95b3ff9a7a53a5c25aa49f04756945f1dbf634.zip | |
Update references in `src/`
Diffstat (limited to 'src/common/utils')
| -rw-r--r-- | src/common/utils/consts.rs | 12 | ||||
| -rw-r--r-- | src/common/utils/logging.rs | 18 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/common/utils/consts.rs b/src/common/utils/consts.rs index 7a0c9ddf..c4a75158 100644 --- a/src/common/utils/consts.rs +++ b/src/common/utils/consts.rs @@ -1,6 +1,6 @@ -pub const MOSAIC_TMP_DIR: &str = "/tmp/mosaic"; -pub const MOSAIC_TMP_LOG_DIR: &str = "/tmp/mosaic/mosaic-log"; -pub const MOSAIC_TMP_LOG_FILE: &str = "/tmp/mosaic/mosaic-log/log.txt"; -pub const MOSAIC_IPC_PIPE: &str = "/tmp/mosaic/ipc"; -pub const MOSAIC_ROOT_PLUGIN_DIR: &str = "/usr/share/mosaic/plugins"; -pub const MOSAIC_ROOT_LAYOUT_DIR: &str = "/usr/share/mosaic/layouts"; +pub const ZELLIJ_TMP_DIR: &str = "/tmp/zellij"; +pub const ZELLIJ_TMP_LOG_DIR: &str = "/tmp/zellij/zellij-log"; +pub const ZELLIJ_TMP_LOG_FILE: &str = "/tmp/zellij/zellij-log/log.txt"; +pub const ZELLIJ_IPC_PIPE: &str = "/tmp/zellij/ipc"; +pub const ZELLIJ_ROOT_PLUGIN_DIR: &str = "/usr/share/zellij/plugins"; +pub const ZELLIJ_ROOT_LAYOUT_DIR: &str = "/usr/share/zellij/layouts"; diff --git a/src/common/utils/logging.rs b/src/common/utils/logging.rs index 05af455c..c568cd56 100644 --- a/src/common/utils/logging.rs +++ b/src/common/utils/logging.rs @@ -5,7 +5,7 @@ use std::{ path::PathBuf, }; -use crate::utils::consts::{MOSAIC_TMP_LOG_DIR, MOSAIC_TMP_LOG_FILE}; +use crate::utils::consts::{ZELLIJ_TMP_LOG_DIR, ZELLIJ_TMP_LOG_FILE}; pub fn atomic_create_file(file_name: &str) { let _ = fs::OpenOptions::new().create(true).open(file_name); @@ -29,11 +29,11 @@ pub fn debug_log_to_file(mut message: String) -> io::Result<()> { } pub fn debug_log_to_file_without_newline(message: String) -> io::Result<()> { - atomic_create_file(MOSAIC_TMP_LOG_FILE); + atomic_create_file(ZELLIJ_TMP_LOG_FILE); let mut file = fs::OpenOptions::new() .append(true) .create(true) - .open(MOSAIC_TMP_LOG_FILE)?; + .open(ZELLIJ_TMP_LOG_FILE)?; file.write_all(message.as_bytes()) } @@ -47,8 +47,8 @@ pub fn _debug_log_to_file_pid_3(message: String, pid: RawFd) -> io::Result<()> { #[allow(dead_code)] pub fn delete_log_file() -> io::Result<()> { - if fs::metadata(MOSAIC_TMP_LOG_FILE).is_ok() { - fs::remove_file(MOSAIC_TMP_LOG_FILE) + if fs::metadata(ZELLIJ_TMP_LOG_FILE).is_ok() { + fs::remove_file(ZELLIJ_TMP_LOG_FILE) } else { Ok(()) } @@ -56,8 +56,8 @@ pub fn delete_log_file() -> io::Result<()> { #[allow(dead_code)] pub fn delete_log_dir() -> io::Result<()> { - if fs::metadata(MOSAIC_TMP_LOG_DIR).is_ok() { - fs::remove_dir_all(MOSAIC_TMP_LOG_DIR) + if fs::metadata(ZELLIJ_TMP_LOG_DIR).is_ok() { + fs::remove_dir_all(ZELLIJ_TMP_LOG_DIR) } else { Ok(()) } @@ -65,8 +65,8 @@ pub fn delete_log_dir() -> io::Result<()> { pub fn debug_to_file(message: u8, pid: RawFd) -> io::Result<()> { let mut path = PathBuf::new(); - path.push(MOSAIC_TMP_LOG_DIR); - path.push(format!("mosaic-{}.log", pid.to_string())); + path.push(ZELLIJ_TMP_LOG_DIR); + path.push(format!("zellij-{}.log", pid.to_string())); let mut file = fs::OpenOptions::new() .append(true) |
