()
| 460 | } |
| 461 | |
| 462 | fn launchctl_domain() -> anyhow::Result<String> { |
| 463 | let output = Command::new("id") |
| 464 | .arg("-u") |
| 465 | .output() |
| 466 | .context("run `id -u`")?; |
| 467 | if !output.status.success() { |
| 468 | bail!("`id -u` failed"); |
| 469 | } |
| 470 | let uid = String::from_utf8(output.stdout) |
| 471 | .context("parse uid as utf-8")? |
| 472 | .trim() |
| 473 | .to_string(); |
| 474 | if uid.is_empty() { |
| 475 | bail!("`id -u` returned an empty uid"); |
| 476 | } |
| 477 | Ok(format!("gui/{uid}")) |
| 478 | } |
| 479 | |
| 480 | fn unload_existing_services(domain: &str) -> anyhow::Result<Vec<u32>> { |
| 481 | let mut killed = Vec::new(); |
no test coverage detected