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

Function studio_host_provider_script

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

Source from the content-addressed store, hash-verified

3462}
3463
3464fn studio_host_provider_script() -> anyhow::Result<PathBuf> {
3465 let mut candidates = Vec::new();
3466 if let Ok(root) = project_root() {
3467 candidates.push(root.join("scripts/studio-host-provider.mjs"));
3468 }
3469 if let Ok(current_exe) = env::current_exe() {
3470 if let Some(package_root) = current_exe.parent().and_then(Path::parent) {
3471 candidates.push(package_root.join("scripts/studio-host-provider.mjs"));
3472 }
3473 }
3474 if let Ok(current_dir) = env::current_dir() {
3475 candidates.push(current_dir.join("scripts/studio-host-provider.mjs"));
3476 }
3477 candidates
3478 .into_iter()
3479 .find(|path| path.is_file())
3480 .ok_or_else(|| anyhow::anyhow!("Unable to find scripts/studio-host-provider.mjs."))
3481}
3482
3483fn run_provider_command(command: ProviderCommand) -> anyhow::Result<()> {
3484 let script = studio_host_provider_script()?;

Callers 1

run_provider_commandFunction · 0.85

Calls 1

project_rootFunction · 0.85

Tested by

no test coverage detected