()
| 3462 | } |
| 3463 | |
| 3464 | fn 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 | |
| 3483 | fn run_provider_command(command: ProviderCommand) -> anyhow::Result<()> { |
| 3484 | let script = studio_host_provider_script()?; |
no test coverage detected