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

Function run_launchctl

packages/server/src/service.rs:519–538  ·  view source on GitHub ↗
(args: [&str; N])

Source from the content-addressed store, hash-verified

517}
518
519fn run_launchctl<const N: usize>(args: [&str; N]) -> anyhow::Result<()> {
520 let output = Command::new("launchctl")
521 .args(args)
522 .output()
523 .context("run launchctl")?;
524 if output.status.success() {
525 return Ok(());
526 }
527
528 let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string();
529 bail!(
530 "launchctl {} failed: {}",
531 args.join(" "),
532 if stderr.is_empty() {
533 "unknown error"
534 } else {
535 &stderr
536 }
537 );
538}
539
540fn terminate_process_group(pid: u32, timeout: Duration) {
541 signal_process_group(pid, "TERM");

Callers 1

installFunction · 0.85

Calls 1

outputMethod · 0.65

Tested by

no test coverage detected