diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-23 17:28:51 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-23 17:28:51 +0200 |
| commit | c8bea2d6a8c6cd6b0950d75646eef0becf1fce1e (patch) | |
| tree | 81e00012524b5b303770e0977769c24716d1f181 /modules/core/c++/environment.hpp | |
| parent | da8cb1c7dd40ef18b85685f99369a31ee36370a1 (diff) | |
| parent | 3489ac1d725c0eadb7d75329f9e6074ed177d125 (diff) | |
| download | libs-lbm-c8bea2d6a8c6cd6b0950d75646eef0becf1fce1e.tar.gz | |
Merge branch 'dev'
Diffstat (limited to 'modules/core/c++/environment.hpp')
| -rw-r--r-- | modules/core/c++/environment.hpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/core/c++/environment.hpp b/modules/core/c++/environment.hpp index d8aa9ae..ed9cd40 100644 --- a/modules/core/c++/environment.hpp +++ b/modules/core/c++/environment.hpp @@ -7,16 +7,23 @@ namespace kel { namespace lbm { -struct environment { +class environment { +public: std::string name; std::filesystem::path lbm_dir; std::filesystem::path data_dir; + std::filesystem::path name_dir; +public: }; -saw::error_or<environment> setup_lbm_env(const std::string_view name){ +template<typename ArgSch> +saw::error_or<environment> init_lbm_env(const saw::data<ArgSch>& args){ namespace fs = std::filesystem; + auto& args_n = args.template get<"args">(); + auto& name = args_n.template get<"name">(); + const char* home_dir = std::getenv("HOME"); if(not home_dir){ return saw::make_error<saw::err::not_found>("Couldn't find home dir"); @@ -42,6 +49,10 @@ saw::error_or<environment> setup_lbm_env(const std::string_view name){ } } + { + env.name_dir = env.data_dir / name.view(); + } + return env; } |
