cppscripts/helpers.cpp
tastytea 3cad575f7c
Add statusweather.
Get weather info from openweathermap.org for use with i3blocks.
2021-08-23 16:53:26 +02:00

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