Skip to content

Commit 429998b

Browse files
committed
hiding logs
1 parent 04ec69a commit 429998b

1 file changed

Lines changed: 9 additions & 41 deletions

File tree

cli/src/docker/compose.rs

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -49,59 +49,27 @@ impl DockerCompose {
4949
println!("(This may take 10-20 minutes on first build)");
5050
println!();
5151

52-
let mut cmd = Command::new("docker");
53-
cmd.arg("compose")
52+
// Build images silently
53+
let build_status = Command::new("docker")
54+
.arg("compose")
5455
.arg("--profile")
5556
.arg(profile)
5657
.arg("build")
57-
.arg("--progress=plain") // Force plain text output
58+
.arg("-q") // Quiet mode
5859
.current_dir(&self.project_dir)
59-
.stdout(Stdio::piped())
60-
.stderr(Stdio::piped());
61-
62-
let mut child = cmd.spawn()
60+
.stdout(Stdio::null()) // Discard stdout
61+
.stderr(Stdio::null()) // Discard stderr
62+
.status()
6363
.map_err(|e| zeckitError::Docker(format!("Failed to start build: {}", e)))?;
6464

65-
// Get both stdout and stderr
66-
let stdout = child.stdout.take();
67-
let stderr = child.stderr.take();
68-
69-
// Spawn threads to read both streams simultaneously
70-
let stdout_thread = thread::spawn(move || {
71-
if let Some(stream) = stdout {
72-
let reader = BufReader::new(stream);
73-
for line in reader.lines().flatten() {
74-
println!("{}", line);
75-
}
76-
}
77-
});
78-
79-
let stderr_thread = thread::spawn(move || {
80-
if let Some(stream) = stderr {
81-
let reader = BufReader::new(stream);
82-
for line in reader.lines().flatten() {
83-
eprintln!("{}", line);
84-
}
85-
}
86-
});
87-
88-
// Wait for both threads
89-
let _ = stdout_thread.join();
90-
let _ = stderr_thread.join();
91-
92-
// Wait for the child process
93-
let status = child.wait()
94-
.map_err(|e| zeckitError::Docker(format!("Build process error: {}", e)))?;
95-
96-
if !status.success() {
65+
if !build_status.success() {
9766
return Err(zeckitError::Docker("Image build failed".into()));
9867
}
9968

100-
println!();
10169
println!("✓ Images built successfully");
10270
println!();
10371

104-
// THEN START SERVICES
72+
// Start services
10573
println!("Starting containers...");
10674
let output = Command::new("docker")
10775
.arg("compose")

0 commit comments

Comments
 (0)