Skip to content

Commit

Permalink
fix: include system env var
Browse files Browse the repository at this point in the history
  • Loading branch information
cestef committed Aug 7, 2024
1 parent e87b3a1 commit 8a318fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ description = "Prints 'Hello, world!' to the console"
_ => {}
}

let env_vars = match &file.dotenv {
let mut env_vars = match &file.dotenv {
Either::Left(Some(dotenv)) => {
debug!("Reading dotenv file: {}", dotenv);
dotenvy::from_filename_iter(dotenv)
Expand All @@ -181,6 +181,9 @@ description = "Prints 'Hello, world!' to the console"
}
};

// Extend with the environment variables from the system
env_vars.extend(std::env::vars().map(|(key, value)| Ok((key, value))));

let env_vars = env_vars
.iter()
.filter_map(|res| {
Expand Down

0 comments on commit 8a318fe

Please sign in to comment.