Skip to content

Commit

Permalink
fix(config): watch/update config given with --config when appropriate (
Browse files Browse the repository at this point in the history
  • Loading branch information
imsnif authored Oct 14, 2024
1 parent 4c6e1b6 commit 0997a00
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions zellij-utils/src/input/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,12 @@ impl Config {
Ok(())
}
pub fn config_file_path(opts: &CliArgs) -> Option<PathBuf> {
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<Config, Option<PathBuf>> {
// if we fail, try to return the PathBuf of the file we were not able to write to
Expand Down

0 comments on commit 0997a00

Please sign in to comment.