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

Function record_injected_bundle

packages/server/src/camera.rs:437–451  ·  view source on GitHub ↗
(udid: &str, bundle_id: &str)

Source from the content-addressed store, hash-verified

435}
436
437fn record_injected_bundle(udid: &str, bundle_id: &str) -> Result<(), AppError> {
438 let mut bundle_ids = read_injected_bundles(udid);
439 if !bundle_ids.iter().any(|current| current == bundle_id) {
440 bundle_ids.push(bundle_id.to_owned());
441 }
442 let payload = json!({
443 "daemonPid": std::process::id(),
444 "bundleIds": bundle_ids,
445 });
446 fs::write(
447 injected_bundles_file(udid),
448 serde_json::to_vec(&payload).map_err(app_internal)?,
449 )
450 .map_err(app_internal)
451}
452
453fn read_injected_bundles(udid: &str) -> Vec<String> {
454 let path = injected_bundles_file(udid);

Callers 1

start_cameraFunction · 0.85

Calls 2

read_injected_bundlesFunction · 0.85
injected_bundles_fileFunction · 0.85

Tested by

no test coverage detected