namespace cutl { /** * @brief Get an environment variable. * * @param name the name of the environment variable. * @param default_value the default value if the variable is not found. * @return std::string the value of the environment variable. */ std::string getenv(const std::string &name, const std::string &default_value); } // namespace cutl
---------------------------------------------TestGetEnv--------------------------------------------- getenv for PATH, result: /usr/local/bin:/usr/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/go/bin USERPROFILE: [2024-06-21 21:32:28.863][E]]0x7ff85b8d5fc0](cutl) [sysutil.cpp:208:getenv] variable [USERPROFILE] not set, fallback to not found not found PROCESSOR_ARCHITECTURE: [2024-06-21 21:32:28.863][E]]0x7ff85b8d5fc0](cutl) [sysutil.cpp:208:getenv] variable [PROCESSOR_ARCHITECTURE] not set, fallback to not found not found HOME: /Users/spencer