From 0cfa9fc07acc3d6a8f55940dd112b23e50917125 Mon Sep 17 00:00:00 2001 From: Joseph Montanaro Date: Fri, 27 Dec 2024 15:49:42 -0500 Subject: [PATCH] correct server socket differentiation --- src-tauri/creddy_cli/src/lib.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src-tauri/creddy_cli/src/lib.rs b/src-tauri/creddy_cli/src/lib.rs index d8043c4..a02db2c 100644 --- a/src-tauri/creddy_cli/src/lib.rs +++ b/src-tauri/creddy_cli/src/lib.rs @@ -35,7 +35,12 @@ mod platform { pub fn server_addr(sock_name: &str) -> PathBuf { let mut path = dirs::runtime_dir() .unwrap_or_else(|| PathBuf::from("/tmp")); - path.push(format!("{sock_name}.sock")); + if cfg!(debug_assertions) { + path.push(format!("{sock_name}.dev.sock")) + } + else { + path.push(format!("{sock_name}.sock")); + } path } } @@ -44,6 +49,11 @@ mod platform { #[cfg(windows)] mod platform { pub fn server_addr(sock_name: &str) -> String { - format!(r"\\.\pipe\{sock_name}") + if cfg!(debug_assertions) { + format!(r"\\.\pipe\{sock_name}.dev") + } + else { + format!(r"\\.\pipe\{sock_name}") + } } }