From 1bfbdea99f5177b2ef4612fa92c0687b030a9d42 Mon Sep 17 00:00:00 2001 From: lucaspalomodevelop Date: Thu, 7 Dec 2023 20:47:23 +0100 Subject: [PATCH 1/3] add nlohmann as submodule --- .gitmodules | 3 +++ libs/json | 1 + libs/libs/json | 1 + 3 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 libs/json create mode 160000 libs/libs/json diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8d9ae47 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "libs/libs/json"] + path = libs/libs/json + url = git@github.com:nlohmann/json.git diff --git a/libs/json b/libs/json new file mode 160000 index 0000000..3780b41 --- /dev/null +++ b/libs/json @@ -0,0 +1 @@ +Subproject commit 3780b41dd070436f3f55327b0a88f27a52e2dfa8 diff --git a/libs/libs/json b/libs/libs/json new file mode 160000 index 0000000..3780b41 --- /dev/null +++ b/libs/libs/json @@ -0,0 +1 @@ +Subproject commit 3780b41dd070436f3f55327b0a88f27a52e2dfa8 From 04a37f422a4cb4d66fc190f30acdbe38897adbea Mon Sep 17 00:00:00 2001 From: lucaspalomodevelop Date: Thu, 7 Dec 2023 20:54:56 +0100 Subject: [PATCH 2/3] revert module-folder mistake --- .gitmodules | 4 ++-- libs/libs/json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 160000 libs/libs/json diff --git a/.gitmodules b/.gitmodules index 8d9ae47..4b8e53f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "libs/libs/json"] - path = libs/libs/json +[submodule "libs/json"] + path = libs/json url = git@github.com:nlohmann/json.git diff --git a/libs/libs/json b/libs/libs/json deleted file mode 160000 index 3780b41..0000000 --- a/libs/libs/json +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3780b41dd070436f3f55327b0a88f27a52e2dfa8 From e4d272fc535da13cb7409ba3cf50a9a665becd24 Mon Sep 17 00:00:00 2001 From: lucaspalomodevelop Date: Fri, 8 Dec 2023 23:13:48 +0100 Subject: [PATCH 3/3] update nlohmann/json include --- src/settings.h | 2 +- src/setup.h | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/settings.h b/src/settings.h index d78ebb5..372846b 100644 --- a/src/settings.h +++ b/src/settings.h @@ -3,7 +3,7 @@ #ifndef SETTINGS_H #define SETTINGS_H -#include +#include "../libs/json/single_include/nlohmann/json.hpp" using json = nlohmann::json; diff --git a/src/setup.h b/src/setup.h index eb5a789..95597e3 100644 --- a/src/setup.h +++ b/src/setup.h @@ -9,7 +9,7 @@ #include #include -#include +#include "../libs/json/single_include/nlohmann/json.hpp" using json = nlohmann::json; class Setup @@ -48,19 +48,16 @@ public: { std::replace(home.begin(), home.end(), '\\', '/'); - std::ofstream file(home + "/.automconfig.json"); - json j = { + json j = { {"editor", editor}, {"search_dirs", {home}}, - {"autom_home_dir", home} - }; + {"autom_home_dir", home}}; file << j.dump(4); file.close(); - } void runSetup()