MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / project_root

Function project_root

packages/server/src/main.rs:2413–2427  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2411}
2412
2413fn project_root() -> anyhow::Result<PathBuf> {
2414 let mut current = env::current_dir().context("resolve current directory")?;
2415 loop {
2416 if current.join(".simdeck").exists()
2417 || current.join(".git").exists()
2418 || current.join("package.json").exists()
2419 || current.join("xcodeproj").exists()
2420 {
2421 return Ok(current);
2422 }
2423 if !current.pop() {
2424 return env::current_dir().context("resolve current directory");
2425 }
2426 }
2427}
2428
2429fn choose_service_port_for_bind(preferred: u16, bind: IpAddr) -> anyhow::Result<u16> {
2430 let port = preferred.max(1024);

Callers 7

start_project_serviceFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected