Browse Source

set config file if xdg is used

xdg
Jørgen Lien Sellæg 5 years ago
parent
commit
c2ac5eb78d
  1. 4
      src/config.cpp

4
src/config.cpp

@ -12,13 +12,13 @@ Config::Config() {
if(auto ptr = std::getenv("XDG_CONFIG_HOME")) { if(auto ptr = std::getenv("XDG_CONFIG_HOME")) {
boost::filesystem::path config_dir(ptr); boost::filesystem::path config_dir(ptr);
home_juci_path = config_dir / "juci"; home_juci_path = config_dir / "juci";
return;
} }
else { else {
boost::filesystem::path config_dir(home_path / "config"); boost::filesystem::path config_dir(home_path / "config");
home_juci_path = config_dir / "juci"; home_juci_path = config_dir / "juci";
return;
} }
juci_config_file = home_juci_path / "config.json";
return;
} }
if(home_path.empty()) if(home_path.empty())
throw std::runtime_error("Could not find home path"); throw std::runtime_error("Could not find home path");

Loading…
Cancel
Save