22 lines
330 B
C++
22 lines
330 B
C++
|
#include "helpers.hpp"
|
||
|
|
||
|
#include <cstdlib>
|
||
|
#include <string>
|
||
|
#include <string_view>
|
||
|
|
||
|
namespace helpers
|
||
|
{
|
||
|
|
||
|
std::string get_env(std::string_view name)
|
||
|
{
|
||
|
const char *env = std::getenv(name.data()); // NOLINT(concurrency-mt-unsafe)
|
||
|
if (env != nullptr)
|
||
|
{
|
||
|
return env;
|
||
|
}
|
||
|
|
||
|
return {};
|
||
|
}
|
||
|
|
||
|
} // namespace helpers
|