mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
feat(env): customizable config file location
This commit is contained in:
parent
4815a096fd
commit
e8a077a5d6
@ -281,6 +281,14 @@ impl Settings {
|
||||
}
|
||||
|
||||
fn get_settings_path() -> PathBuf {
|
||||
if let Some(val) = std::env::var_os("VOXYGEN_CONFIG") {
|
||||
let settings = PathBuf::from(val).join("settings.ron");
|
||||
if settings.exists() || settings.parent().map(|x| x.exists()).unwrap_or(false) {
|
||||
return settings;
|
||||
}
|
||||
log::warn!("VOXYGEN_CONFIG points to invalid path.");
|
||||
}
|
||||
|
||||
let proj_dirs = ProjectDirs::from("net", "veloren", "voxygen")
|
||||
.expect("System's $HOME directory path not found!");
|
||||
proj_dirs
|
||||
|
Loading…
Reference in New Issue
Block a user