implement command to reload config (#243)
* implement command to reload themes * refresh keybindings after config reload
This commit is contained in:
committed by
GitHub
parent
9e5e3f3089
commit
4f71b2489b
@@ -53,6 +53,11 @@ lazy_static! {
|
||||
pub static ref BASE_PATH: RwLock<Option<PathBuf>> = RwLock::new(None);
|
||||
}
|
||||
|
||||
pub fn load() -> Result<Config, String> {
|
||||
let path = config_path("config.toml");
|
||||
load_or_generate_default(path, |_| Ok(Config::default()), false)
|
||||
}
|
||||
|
||||
fn proj_dirs() -> ProjectDirs {
|
||||
match *BASE_PATH.read().expect("can't readlock BASE_PATH") {
|
||||
Some(ref basepath) => ProjectDirs::from_path(basepath.clone()).expect("invalid basepath"),
|
||||
|
||||
Reference in New Issue
Block a user