(name: &str)
| 498 | } |
| 499 | |
| 500 | fn camera_artifact_path(name: &str) -> anyhow::Result<PathBuf> { |
| 501 | let exe = std::env::current_exe().context("resolve current executable")?; |
| 502 | let exe_dir = exe |
| 503 | .parent() |
| 504 | .ok_or_else(|| anyhow!("current executable has no parent directory"))?; |
| 505 | let cwd = std::env::current_dir().context("resolve current directory")?; |
| 506 | let candidates = [ |
| 507 | exe_dir.join("camera").join(name), |
| 508 | exe_dir.join(name), |
| 509 | cwd.join("build").join("camera").join(name), |
| 510 | cwd.join("cli").join("camera").join("build").join(name), |
| 511 | ]; |
| 512 | candidates |
| 513 | .into_iter() |
| 514 | .find(|path| path.is_file()) |
| 515 | .ok_or_else(|| { |
| 516 | anyhow!( |
| 517 | "Camera artifact `{}` is missing. Run `npm run build:cli` from the SimDeck checkout.", |
| 518 | name |
| 519 | ) |
| 520 | }) |
| 521 | } |
| 522 | |
| 523 | fn app_internal(error: impl std::fmt::Display) -> AppError { |
| 524 | AppError::internal(error.to_string()) |
no outgoing calls
no test coverage detected