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

Function installed_arguments_from_plist

packages/server/src/service.rs:393–412  ·  view source on GitHub ↗
(plist_path: &Path)

Source from the content-addressed store, hash-verified

391}
392
393fn installed_arguments_from_plist(plist_path: &Path) -> anyhow::Result<Option<Vec<String>>> {
394 if !plist_path.exists() {
395 return Ok(None);
396 }
397 let plist = plist::Value::from_file(plist_path)
398 .with_context(|| format!("read {}", plist_path.display()))?;
399 let Some(arguments) = plist
400 .as_dictionary()
401 .and_then(|dict| dict.get("ProgramArguments"))
402 .and_then(|value| value.as_array())
403 else {
404 return Ok(None);
405 };
406 let arguments = arguments
407 .iter()
408 .filter_map(|value| value.as_string())
409 .map(ToOwned::to_owned)
410 .collect::<Vec<_>>();
411 Ok(Some(arguments))
412}
413
414fn installed_executable_path(arguments: &[String]) -> PathBuf {
415 arguments

Callers 2

installed_argumentsFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected