mirror of
https://github.com/NixOS/nix
synced 2025-06-26 20:01:15 +02:00
Merge pull request #7918 from zimbatm/fix-empty-nix-store-env
treat empty NIX_STORE_DIR env vars as unset
This commit is contained in:
commit
0507462c06
4 changed files with 17 additions and 8 deletions
|
@ -54,6 +54,11 @@ std::optional<std::string> getEnv(const std::string & key)
|
|||
return std::string(value);
|
||||
}
|
||||
|
||||
std::optional<std::string> getEnvNonEmpty(const std::string & key) {
|
||||
auto value = getEnv(key);
|
||||
if (value == "") return {};
|
||||
return value;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> getEnv()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue