diff --git a/src/ll/api/Config.h b/src/ll/api/Config.h index 67193869bb..02720c8595 100644 --- a/src/ll/api/Config.h +++ b/src/ll/api/Config.h @@ -32,7 +32,11 @@ bool defaultConfigUpdater(T& config, J& data) { template inline bool loadConfig(T& config, std::filesystem::path const& path, F&& updater = defaultConfigUpdater) { bool noNeedRewrite = true; - auto content = file_utils::readFile(path); + namespace fs = std::filesystem; + if (!fs::exists(path)) { + saveConfig(config, path); + } + auto content = file_utils::readFile(path); if (content && !content->empty()) { auto data{J::parse(*content, nullptr, true, true)}; if (!data.contains("version")) {