diff --git a/src/config.cpp b/src/config.cpp index a2d9e35..68abb95 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -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() diff --git a/src/config.hpp b/src/config.hpp index a71e7a6..ac3d820 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -69,6 +69,8 @@ public: ProfileData data; void write(); + [[nodiscard]] + fs::path get_config_dir() const; private: const string _profile;