mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Theme provider and '-t' and '-c' CLI options
This commit is contained in:
@@ -93,6 +93,17 @@ pub fn get_log_paths(config_dir: &Path) -> PathBuf {
|
||||
log_file
|
||||
}
|
||||
|
||||
/// ### get_theme_path
|
||||
///
|
||||
/// Get paths for theme provider
|
||||
/// Returns: path of theme.toml
|
||||
pub fn get_theme_path(config_dir: &Path) -> PathBuf {
|
||||
// Prepare paths
|
||||
let mut theme_file: PathBuf = PathBuf::from(config_dir);
|
||||
theme_file.push("theme.toml");
|
||||
theme_file
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
@@ -157,4 +168,12 @@ mod tests {
|
||||
PathBuf::from("/home/omar/.config/termscp/termscp.log"),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_system_environment_get_theme_path() {
|
||||
assert_eq!(
|
||||
get_theme_path(&Path::new("/home/omar/.config/termscp/")),
|
||||
PathBuf::from("/home/omar/.config/termscp/theme.toml"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user