Skip to content

Commit

Permalink
feat: add method for setting env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
zmitchell committed Aug 8, 2023
1 parent d5f2d7e commit 85e608e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/runix/src/command_line/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ impl NixCommandLine {

M::run(&mut command).await
}

// Set the global Nix config via the environment variables in flox.default_args so that
// subprocesses called by `flox` (e.g. `parser-util`) can inherit them.
pub fn export_config_env_vars(&self) {
for (name, value) in self.defaults.environment.iter() {
std::env::set_var(name, value);
}
}
}

/// Create a list of arguments from `&Self`
Expand Down

0 comments on commit 85e608e

Please sign in to comment.