ensured building on ubuntu 18.04
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
#include "settings.h"
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
#include "../utils/utils.h"
|
||||
|
||||
#if __GNUC__ < 8
|
||||
# include <experimental/filesystem>
|
||||
using namespace std::experimental;
|
||||
#else
|
||||
# include <filesystem>
|
||||
using std::filesystem;
|
||||
#endif
|
||||
|
||||
Settings::Settings(std::string path) {
|
||||
this->settings_file_path = path;
|
||||
|
||||
if (!std::filesystem::exists(path)) {
|
||||
if (!filesystem::exists(path)) {
|
||||
std::ofstream output(path);
|
||||
|
||||
nlohmann::json settings = R"({
|
||||
@@ -53,8 +60,8 @@ Settings::Settings(std::string path) {
|
||||
this->settings = settings;
|
||||
}
|
||||
|
||||
std::filesystem::create_directories(get_path_relative_to_home(this->settings["ofds_modules_dir"]));
|
||||
std::filesystem::create_directories(get_path_relative_to_home(this->settings["stores_modules_dir"]));
|
||||
filesystem::create_directories(get_path_relative_to_home(this->settings["ofds_modules_dir"]));
|
||||
filesystem::create_directories(get_path_relative_to_home(this->settings["stores_modules_dir"]));
|
||||
}
|
||||
|
||||
void Settings::write_setting(std::string setting, std::string value) {
|
||||
|
||||
Reference in New Issue
Block a user