summaryrefslogtreecommitdiff
path: root/c++/environment.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-07-30 18:04:13 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-07-30 18:04:13 +0200
commit4968da9a05df5c10fb1f10655189ae251b38f92b (patch)
tree3f8fa3d1d4950e9969897138d904854189bdaab8 /c++/environment.hpp
parentd9fb04fe614c67f5a7850fc3f32338757b1b2987 (diff)
Way too many changes
Diffstat (limited to 'c++/environment.hpp')
-rw-r--r--c++/environment.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/c++/environment.hpp b/c++/environment.hpp
new file mode 100644
index 0000000..6b63f16
--- /dev/null
+++ b/c++/environment.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <forstio/error.hpp>
+#include <filesystem>
+#include <cstdlib>
+
+namespace kel {
+namespace lbm {
+
+saw::error_or<std::filesystem::path> output_directory(){
+ const char* home_dir = std::getenv("HOME");
+ if(not home_dir){
+ return saw::make_error<saw::err::not_found>("Couldn't find home dir");
+ }
+
+ return std::filesystem::path{home_dir} / ".lbm/";
+}
+}
+}