diff --git a/zk_toolbox/crates/common/src/prerequisites.rs b/zk_toolbox/crates/common/src/prerequisites.rs index ed9f189a02a1..ae21ba68b3c1 100644 --- a/zk_toolbox/crates/common/src/prerequisites.rs +++ b/zk_toolbox/crates/common/src/prerequisites.rs @@ -25,6 +25,11 @@ const PREREQUISITES: [Prerequisite; 5] = [ }, ]; +const DOCKER_COMPOSE_PREREQUISITE: Prerequisite = Prerequisite { + name: "docker compose", + download_link: "https://docs.docker.com/compose/install/", +}; + struct Prerequisite { name: &'static str, download_link: &'static str, @@ -39,6 +44,10 @@ pub fn check_prerequisites(shell: &Shell) { } } + if !check_docker_compose_prerequisite(shell) { + missing_prerequisites.push(&DOCKER_COMPOSE_PREREQUISITE); + } + if !missing_prerequisites.is_empty() { logger::error("Prerequisite check has failed"); logger::error_note( @@ -59,3 +68,9 @@ pub fn check_prerequisites(shell: &Shell) { fn check_prerequisite(shell: &Shell, name: &str) -> bool { Cmd::new(cmd!(shell, "which {name}")).run().is_ok() } + +fn check_docker_compose_prerequisite(shell: &Shell) -> bool { + Cmd::new(cmd!(shell, "docker compose version")) + .run() + .is_ok() +}