Fix parsing of direnv export json to support unset of environment variables + better logging (#32559)
Release Notes: - Fixed parsing of `direnv export json` output to support unset of environment variables.
This commit is contained in:
@@ -274,7 +274,13 @@ async fn load_shell_environment(
|
||||
},
|
||||
};
|
||||
if let Some(direnv_environment) = direnv_environment {
|
||||
envs.extend(direnv_environment);
|
||||
for (key, value) in direnv_environment {
|
||||
if let Some(value) = value {
|
||||
envs.insert(key, value);
|
||||
} else {
|
||||
envs.remove(&key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(Some(envs), direnv_error)
|
||||
|
||||
Reference in New Issue
Block a user