Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions crates/cli/src/docker_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ fn is_command_available(command: &str) -> bool {

pub fn handle_docker_start(compose_path: String, env_path: Option<String>) -> Result<()> {
println!("Starting Commit-Boost with compose file: {}", compose_path);
windows_not_supported();

// load env file if present
if let Some(env_path) = env_path {
Expand All @@ -93,6 +94,7 @@ pub fn handle_docker_start(compose_path: String, env_path: Option<String>) -> Re

pub fn handle_docker_stop(compose_path: String, env_path: String) -> Result<()> {
println!("Stopping Commit-Boost with compose file: {}", compose_path);
windows_not_supported();

// load env file
dotenvy::from_filename_override(env_path)?;
Expand All @@ -105,9 +107,21 @@ pub fn handle_docker_stop(compose_path: String, env_path: String) -> Result<()>

pub fn handle_docker_logs(compose_path: String) -> Result<()> {
println!("Querying Commit-Boost with compose file: {}", compose_path);
windows_not_supported();

// start docker compose
run_docker_compose!(compose_path, "logs", "-f");

Ok(())
}

#[cfg(target_os = "windows")]
fn windows_not_supported() {
eprintln!(
"Windows is currently only partially supported, please run `docker compose` manually and consider filing an issue at https://github.com/Commit-Boost/commit-boost-client"
);
std::process::exit(1);
}

#[cfg(not(target_os = "windows"))]
fn windows_not_supported() {}