2021-08-23 16:53:26 +02:00
|
|
|
#include "helpers.hpp"
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <string>
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
namespace helpers
|
|
|
|
{
|
|
|
|
|
|
|
|
std::string get_env(std::string_view name)
|
|
|
|
{
|
2021-08-23 19:31:14 +02:00
|
|
|
const char *env{std::getenv(name.data())}; // NOLINT(concurrency-mt-unsafe)
|
2021-08-23 16:53:26 +02:00
|
|
|
if (env != nullptr)
|
|
|
|
{
|
|
|
|
return env;
|
|
|
|
}
|
|
|
|
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace helpers
|