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

Function setup

src/executor/helpers/introspected_nodejs/mod.rs:8–19  ·  view source on GitHub ↗

Creates the `node` script that will replace the `node` binary while running Returns the path to the script folder, which should be added to the PATH environment variable

()

Source from the content-addressed store, hash-verified

6/// Creates the `node` script that will replace the `node` binary while running
7/// Returns the path to the script folder, which should be added to the PATH environment variable
8pub(crate) fn setup() -> Result<PathBuf> {
9 let script_folder = env::temp_dir().join("codspeed_introspected_node");
10 std::fs::create_dir_all(&script_folder)?;
11 let script_path = script_folder.join("node");
12 let mut script_file = File::create(script_path)?;
13 script_file.write_all(INTROSPECTED_NODE_SCRIPT.as_bytes())?;
14 // Make the script executable
15 let mut perms = script_file.metadata()?.permissions();
16 perms.set_mode(0o755);
17 script_file.set_permissions(perms)?;
18 Ok(script_folder)
19}

Callers 2

runMethod · 0.50
build_path_envFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected