Add support for macOS builds (apple silicon) (#557)

This commit is contained in:
Olivier Louvignes authored and GitHub committed 2025-12-01 22:43:00 +08:00
1 parent 8ed3304e61
commit a917e16e62
2 files changed
+30 -10

No files matched your search

+12 -4
View File
@@ -11,10 +11,18 @@ pub trait CommandExt {
impl CommandExt for Command {
fn new_pkexec<S: AsRef<OsStr>>(program: S) -> Command {
let mut cmd = Command::new("pkexec");
cmd.arg("--user").arg("root").arg(program);
cmd
#[cfg(target_os = "macos")]
{
let mut cmd = Command::new("sudo");
cmd.arg(program);
cmd
}
#[cfg(not(target_os = "macos"))]
{
let mut cmd = Command::new("pkexec");
cmd.arg("--user").arg("root").arg(program);
cmd
}
}
fn into_non_root(mut self) -> anyhow::Result<Command> {