MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / camera_artifact_path

Function camera_artifact_path

packages/server/src/camera.rs:500–521  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

498}
499
500fn 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
523fn app_internal(error: impl std::fmt::Display) -> AppError {
524 AppError::internal(error.to_string())

Callers 1

camera_injector_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected