From 61e052f22a626f6783957773176f8a7064a547eb Mon Sep 17 00:00:00 2001 From: leca Date: Sat, 5 Oct 2024 15:03:17 +0300 Subject: [PATCH] creating dirs --- main.cpp | 4 ++++ settings/settings.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/main.cpp b/main.cpp index b58fdf7..a9e3ac8 100644 --- a/main.cpp +++ b/main.cpp @@ -6,10 +6,14 @@ #include #include #include +#include int main(int argc, char *argv[]) { curl_global_init(CURL_GLOBAL_ALL); + std::string program_data_path = get_path_relative_to_home(".local/share/checks_parser"); + std::filesystem::create_directories(program_data_path); + std::string settings_file_path = get_path_relative_to_home(".local/share/checks_parser/settings.json"); diff --git a/settings/settings.cpp b/settings/settings.cpp index f86a9c2..5c69419 100644 --- a/settings/settings.cpp +++ b/settings/settings.cpp @@ -3,6 +3,7 @@ #include #include #include +#include "../utils/utils.h" Settings::Settings(std::string path) { this->settings_file_path = path; @@ -51,6 +52,9 @@ Settings::Settings(std::string path) { nlohmann::json settings = nlohmann::json::parse(input); 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"])); } void Settings::write_setting(std::string setting, std::string value) {