mirror of
https://github.com/zellij-org/zellij.git
synced 2024-11-26 10:55:12 +03:00
fix(config): watch/update config given with --config when appropriate (#3678)
This commit is contained in:
parent
4c6e1b6564
commit
0997a0035d
@ -238,10 +238,12 @@ impl Config {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
pub fn config_file_path(opts: &CliArgs) -> Option<PathBuf> {
|
pub fn config_file_path(opts: &CliArgs) -> Option<PathBuf> {
|
||||||
|
opts.config.clone().or_else(|| {
|
||||||
opts.config_dir
|
opts.config_dir
|
||||||
.clone()
|
.clone()
|
||||||
.or_else(home::find_default_config_dir)
|
.or_else(home::find_default_config_dir)
|
||||||
.map(|config_dir| config_dir.join(DEFAULT_CONFIG_FILE_NAME))
|
.map(|config_dir| config_dir.join(DEFAULT_CONFIG_FILE_NAME))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
pub fn write_config_to_disk(config: String, opts: &CliArgs) -> Result<Config, Option<PathBuf>> {
|
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
|
// if we fail, try to return the PathBuf of the file we were not able to write to
|
||||||
|
Loading…
Reference in New Issue
Block a user