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

Function set_node_options

crates/exec-harness/src/node.rs:7–18  ·  view source on GitHub ↗

Appends CodSpeed-required Node.js options to `NODE_OPTIONS` on a [`Command`], preserving any existing value from the environment.

(cmd: &mut Command)

Source from the content-addressed store, hash-verified

5/// Appends CodSpeed-required Node.js options to `NODE_OPTIONS` on a [`Command`],
6/// preserving any existing value from the environment.
7pub fn set_node_options(cmd: &mut Command) {
8 let existing = std::env::var("NODE_OPTIONS").unwrap_or_default();
9 let mut parts: Vec<&str> = existing.split_whitespace().collect();
10
11 for opt in NODE_OPTIONS_TO_ADD {
12 if !parts.contains(opt) {
13 parts.push(opt);
14 }
15 }
16
17 cmd.env("NODE_OPTIONS", parts.join(" "));
18}

Callers 2

run_roundsFunction · 0.85
perform_with_valgrindFunction · 0.85

Calls 1

envMethod · 0.80

Tested by

no test coverage detected