mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
getEnv(): Return std::optional
This allows distinguishing between an empty value and no value.
This commit is contained in:
parent
fd900c45b5
commit
ba87b08f85
17 changed files with 60 additions and 63 deletions
|
@ -1425,7 +1425,7 @@ static int _main(int argc, char * * argv)
|
|||
globals.instSource.autoArgs = myArgs.getAutoArgs(*globals.state);
|
||||
|
||||
if (globals.profile == "")
|
||||
globals.profile = getEnv("NIX_PROFILE", "");
|
||||
globals.profile = getEnv("NIX_PROFILE").value_or("");
|
||||
|
||||
if (globals.profile == "") {
|
||||
Path profileLink = getHome() + "/.nix-profile";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue