From c99bd015aa6ede7d306838c71d0ad6b89950a56b Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 7 Nov 2023 23:07:42 +0800 Subject: feat: temporarily use a role to send a message (#227) --- src/config/mod.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/config/mod.rs') diff --git a/src/config/mod.rs b/src/config/mod.rs index 3d4df7d..05c681b 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -344,7 +344,7 @@ impl Config { } pub fn sys_info(&self) -> Result { - let path_info = |path: &Path| { + let display_path = |path: &Path| { let state = if path.exists() { "" } else { " ⚠️" }; format!("{}{state}", path.display()) }; @@ -355,6 +355,11 @@ impl Config { .wrap .clone() .map_or_else(|| String::from("no"), |v| v.to_string()); + let prelude = if self.prelude.is_empty() { + String::from("-") + } else { + self.prelude.clone() + }; let items = vec![ ("model", self.model.id()), ("temperature", temperature), @@ -365,10 +370,11 @@ impl Config { ("wrap_code", self.wrap_code.to_string()), ("light_theme", self.light_theme.to_string()), ("keybindings", self.keybindings.stringify().into()), - ("config_file", path_info(&Self::config_file()?)), - ("roles_file", path_info(&Self::roles_file()?)), - ("messages_file", path_info(&Self::messages_file()?)), - ("sessions_dir", path_info(&Self::sessions_dir()?)), + ("prelude", prelude), + ("config_file", display_path(&Self::config_file()?)), + ("roles_file", display_path(&Self::roles_file()?)), + ("messages_file", display_path(&Self::messages_file()?)), + ("sessions_dir", display_path(&Self::sessions_dir()?)), ]; let output = items .iter() -- cgit v1.2.3