From 0997a0035d385cf8ebd3b871fb9a614318730d94 Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Mon, 14 Oct 2024 18:01:11 +0200 Subject: [PATCH] fix(config): watch/update config given with --config when appropriate (#3678) --- zellij-utils/src/input/config.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zellij-utils/src/input/config.rs b/zellij-utils/src/input/config.rs index ae574b993..7ce8f63af 100644 --- a/zellij-utils/src/input/config.rs +++ b/zellij-utils/src/input/config.rs @@ -238,10 +238,12 @@ impl Config { Ok(()) } pub fn config_file_path(opts: &CliArgs) -> Option { - opts.config_dir - .clone() - .or_else(home::find_default_config_dir) - .map(|config_dir| config_dir.join(DEFAULT_CONFIG_FILE_NAME)) + opts.config.clone().or_else(|| { + opts.config_dir + .clone() + .or_else(home::find_default_config_dir) + .map(|config_dir| config_dir.join(DEFAULT_CONFIG_FILE_NAME)) + }) } pub fn write_config_to_disk(config: String, opts: &CliArgs) -> Result> { // if we fail, try to return the PathBuf of the file we were not able to write to