Add function Config::get_config_dir().
This commit is contained in:
parent
23ec71ff60
commit
f0c4d63548
|
@ -94,7 +94,7 @@ Config::Config(string profile)
|
|||
}
|
||||
}
|
||||
|
||||
fs::path Config::get_filename() const
|
||||
fs::path Config::get_config_dir() const
|
||||
{
|
||||
char *envdir = getenv("XDG_CONFIG_HOME");
|
||||
fs::path dir;
|
||||
|
@ -122,7 +122,12 @@ fs::path Config::get_filename() const
|
|||
BOOST_LOG_TRIVIAL(debug) << "Created config dir: " << dir;
|
||||
}
|
||||
|
||||
return dir /= "config-" + _profile + ".json";
|
||||
return dir;
|
||||
}
|
||||
|
||||
fs::path Config::get_filename() const
|
||||
{
|
||||
return get_config_dir() /= "config-" + _profile + ".json";
|
||||
}
|
||||
|
||||
void Config::generate()
|
||||
|
|
|
@ -69,6 +69,8 @@ public:
|
|||
ProfileData data;
|
||||
|
||||
void write();
|
||||
[[nodiscard]]
|
||||
fs::path get_config_dir() const;
|
||||
|
||||
private:
|
||||
const string _profile;
|
||||
|
|
Loading…
Reference in New Issue
Block a user