MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / create_env_file

Function create_env_file

src/executor/helpers/run_with_env.rs:53–65  ·  view source on GitHub ↗
(extra_env: &HashMap<String, String>)

Source from the content-addressed store, hash-verified

51}
52
53fn create_env_file(extra_env: &HashMap<String, String>) -> Result<NamedTempFile> {
54 let system_env = get_exported_system_env()?;
55 let base_injected_env = extra_env
56 .iter()
57 .map(|(k, v)| format!("export {k}='{v}'"))
58 .collect::<Vec<_>>()
59 .join("\n");
60
61 // Create and return the environment file
62 let mut env_file = NamedTempFile::new()?;
63 env_file.write_all(format!("{system_env}\n{base_injected_env}").as_bytes())?;
64 Ok(env_file)
65}

Callers 1

wrap_with_envFunction · 0.85

Calls 1

get_exported_system_envFunction · 0.85

Tested by

no test coverage detected