Skip to content

Commit 91712c9

Browse files
authored
CBST-14: exit codes (#175)
1 parent 9f3bb4a commit 91712c9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

crates/cli/src/docker_cmd.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,23 @@ macro_rules! run_docker_compose {
1919
if !output.status.success() {
2020
let stderr = str::from_utf8(&output.stderr).unwrap_or("");
2121
if stderr.contains("permission denied") {
22-
println!("Warning: Permission denied. Try running with sudo.");
22+
eprintln!("Warning: Permission denied. Try running with sudo.");
23+
std::process::exit(1);
2324
} else {
24-
println!("Command failed with error: {}", stderr);
25+
eprintln!("Command failed with error: {}", stderr);
26+
std::process::exit(1);
2527
}
2628
}
2729
}
2830
Err(e) => {
29-
println!("Failed to execute command: {}", e);
31+
eprintln!("Failed to execute command: {}", e);
32+
std::process::exit(1);
3033
}
3134
}
3235
}
3336
None => {
34-
println!("Neither `docker compose` nor `docker-compose` were found on your operating system.");
37+
eprintln!("Neither `docker compose` nor `docker-compose` were found on your operating system.");
38+
std::process::exit(1);
3539
}
3640
}
3741
}};

0 commit comments

Comments
 (0)