cppscripts/helpers.cpp

22 lines
329 B
C++
Raw Normal View History

#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)
if (env != nullptr)
{
return env;
}
return {};
}
} // namespace helpers