MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / workspace_dir

Function workspace_dir

contracts/binding/build.rs:158–169  ·  view source on GitHub ↗

Find the root of the workspace, not this crate, which is what `env!("CARGO_MANIFEST_DIR")` would return

()

Source from the content-addressed store, hash-verified

156
157// Find the root of the workspace, not this crate, which is what `env!("CARGO_MANIFEST_DIR")` would return
158fn workspace_dir() -> PathBuf {
159 let output = std::process::Command::new(env!("CARGO"))
160 .arg("locate-project")
161 .arg("--workspace")
162 .arg("--message-format=plain")
163 .output()
164 .unwrap()
165 .stdout;
166
167 let cargo_path = Path::new(std::str::from_utf8(&output).unwrap().trim());
168 cargo_path.parent().unwrap().to_path_buf()
169}

Callers 1

mainFunction · 0.70

Calls 1

parentMethod · 0.45

Tested by

no test coverage detected