Line data Source code
1 : #include "utils/require_env.hpp" 2 : 3 : #include <stdexcept> 4 : 5 : using namespace std; 6 : using namespace utils; 7 : 8 0 : string utils::require_env(const string &name) { 9 0 : const char *value = getenv(name.c_str()); 10 0 : if(value == nullptr) { 11 0 : throw runtime_error("Environment variable " + name + " is not set."); 12 : } 13 0 : return value; 14 : }