MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / env_flag_enabled

Function env_flag_enabled

src/python/runner.cpp:186–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184
185 namespace {
186 bool env_flag_enabled(const char* name, const bool default_value) {
187 const char* value = std::getenv(name);
188 if (!value || !*value) {
189 return default_value;
190 }
191
192 const std::string_view text(value);
193 if (text == "1" || text == "true" || text == "TRUE" || text == "on" || text == "yes") {
194 return true;
195 }
196 if (text == "0" || text == "false" || text == "FALSE" || text == "off" || text == "no") {
197 return false;
198 }
199 return default_value;
200 }
201
202 bool prepend_sys_path_once(PyObject* const sys_path,
203 const std::filesystem::path& path,

Callers 2

start_dev_python_watcherFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected