diff --git a/src/main.rs b/src/main.rs index 2dd137f..34980a9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -217,12 +217,18 @@ pub fn build(image: &str, ci: bool) { "bash", "-c", &cmd, ]); - Command::new("docker") + let cmd = if is_podman_installed() { + "podman" + } else { + "docker" + }; + + Command::new(cmd) .stderr(Stdio::inherit()) .stdout(Stdio::inherit()) .args(args) .status() - .expect("Failed to start Docker") + .expect("Failed to start Docker or podman") }; if !status.success() { @@ -254,6 +260,14 @@ pub fn find_package_files() -> Vec { .collect() } +fn is_podman_installed() -> bool { + Command::new("podman") + .arg("--version") + .output() + .map(|output| output.status.success()) + .unwrap_or(false) +} + pub fn pacco_push(package: &str, repo: &str, signed: bool) { let pacco_domain = std::env::var("PACCO_HOST").unwrap(); let pkg = package;