Merge branch 'songtronix/set-voxygen-config-via-env' into 'master'

customizable config file location via environment variable

See merge request 
This commit is contained in:
Marcel 2019-10-25 18:52:38 +00:00
commit 572196ed10

@ -285,6 +285,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