From b9aacd9c2fdc61721c8ca3e1b40ebc92daa3772e Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 5 Nov 2025 13:38:04 +0100 Subject: Reworking structure --- lib/core/c++/environment.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/core/c++/environment.hpp (limited to 'lib/core/c++/environment.hpp') diff --git a/lib/core/c++/environment.hpp b/lib/core/c++/environment.hpp new file mode 100644 index 0000000..4915e3a --- /dev/null +++ b/lib/core/c++/environment.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include + +namespace kel { +namespace lbm { + +/** + * Returns the default output directory. + * Located outside the project dir because dispatching build jobs with output data in the git directory + * also copies simulated data which takes a long time. + */ +saw::error_or output_directory(){ + const char* home_dir = std::getenv("HOME"); + if(not home_dir){ + return saw::make_error("Couldn't find home dir"); + } + + return std::filesystem::path{home_dir} / ".lbm"; +} +} +} -- cgit v1.2.3