diff options
Diffstat (limited to 'env.cpp')
-rw-r--r-- | env.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -0,0 +1,13 @@ +#include "env.h" + +#include <cstdlib> + +std::string env_value(const std::string& key) { + char* value_ptr{std::getenv(key.c_str())}; + if (value_ptr == nullptr) { + return {}; + } else { + return value_ptr; + } +} + |