Skip to content

Commit

Permalink
Merge pull request #1086 from pkgxdev/fix-sub-env
Browse files Browse the repository at this point in the history
this fixes subprogs missing keys
  • Loading branch information
mxcl authored Jan 17, 2025
2 parents f6d9880 + 59997fd commit 31ba978
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/lib/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ fn suffixes(key: &EnvKey) -> Option<Vec<&'static str>> {
}

pub fn mix(input: HashMap<String, Vec<String>>) -> HashMap<String, String> {
let mut rv = HashMap::new();
let mut rv = HashMap::from_iter(std::env::vars());

for (key, mut value) in std::env::vars() {
if let Some(injected_values) = input.get(&key) {
value = format!("{}:{}", injected_values.join(":"), value);
for (key, value) in input.iter() {
if let Some(values) = rv.get(key) {
rv.insert(key.clone(), format!("{}:{}", value.join(":"), values));
} else {
rv.insert(key.clone(), value.join(":"));
}
rv.insert(key, value);
}

rv
Expand Down

0 comments on commit 31ba978

Please sign in to comment.